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
12
accept.go
12
accept.go
|
@ -144,13 +144,13 @@ func (b *BlockChain) maybeAcceptBlock(block *btcutil.Block, fastAdd bool) error
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prune block nodes which are no longer needed before creating
|
||||
// a new node.
|
||||
err = b.pruneBlockNodes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Prune block nodes which are no longer needed before creating
|
||||
// a new node.
|
||||
err = b.pruneBlockNodes()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create a new block node for the block and add it to the in-memory
|
||||
|
|
Loading…
Reference in a new issue