From 8962ce7f188cfbb04e30ded1ba6465f0f2205f88 Mon Sep 17 00:00:00 2001 From: Ryan Staudt Date: Thu, 2 Dec 2021 13:32:13 -0600 Subject: [PATCH] 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. --- blockchain/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockchain/validate.go b/blockchain/validate.go index 74f89a80..238f3f91 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -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