Prune the block node index in fast add mode too.
The recent addition of the fast add path to support headers first was not running the block node index pruning code which removes unneeded block nodes from memory. This resulted in higher memory usage than needed in fast add mode.
This commit is contained in:
parent
7390a62a8d
commit
6a9997583a
1 changed files with 6 additions and 6 deletions
|
@ -144,6 +144,7 @@ func (b *BlockChain) maybeAcceptBlock(block *btcutil.Block, fastAdd bool) error
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prune block nodes which are no longer needed before creating
|
||||
// a new node.
|
||||
|
@ -151,7 +152,6 @@ func (b *BlockChain) maybeAcceptBlock(block *btcutil.Block, fastAdd bool) error
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// Create a new block node for the block and add it to the in-memory
|
||||
// block chain (could be either a side chain or the main chain).
|
||||
|
|
Loading…
Reference in a new issue