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:
Dave Collins 2014-01-28 13:45:49 -06:00
parent 7390a62a8d
commit 6a9997583a

View file

@ -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