blockchain: Bulk import skip script validation.

This updates block validation to not run scripts if bulk import mode is
enabled.  Bulk import mode is only enabled when importing blocks that
are already known to be valid.
This commit is contained in:
Ryan Staudt 2021-12-02 13:32:13 -06:00 committed by Dave Collins
parent 23c8ff6385
commit 8962ce7f18

View File

@ -3820,7 +3820,7 @@ func (b *BlockChain) checkConnectBlock(node *blockNode, block, parent *dcrutil.B
// node). This is a huge optimization because running the scripts is the
// most time consuming portion of block handling.
runScripts := !b.noVerify
if b.isAssumeValidAncestor(node) {
if b.bulkImportMode || b.isAssumeValidAncestor(node) {
runScripts = false
}
var scriptFlags txscript.ScriptFlags