From f7d5a807f138e5f7a31a80d696101cfd56563568 Mon Sep 17 00:00:00 2001 From: Calvin Kim Date: Thu, 1 Feb 2024 21:19:02 +0900 Subject: [PATCH] blockchain: don't flush index on ProcessBlockHeader To avoid additional code dealing with starting from a point where we already have some headers, don't flush the index after just verifying one header. This also has the side-effect of making the process bit faster since there's no disk i/o happening now. --- blockchain/process.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/blockchain/process.go b/blockchain/process.go index bd10abf4..42b9e70a 100644 --- a/blockchain/process.go +++ b/blockchain/process.go @@ -175,10 +175,6 @@ func (b *BlockChain) ProcessBlockHeader(header *wire.BlockHeader) error { if err != nil { return err } - err = b.index.flushToDB() - if err != nil { - return err - } return nil }