From 991a72e34e351d93b00d0a5a836f10b1eb9f9229 Mon Sep 17 00:00:00 2001 From: Dave Collins <davec@conformal.com> Date: Mon, 21 Aug 2017 04:07:52 -0500 Subject: [PATCH] blockchain: Remove unused verify disable code. This removes the DisableVerify function and related state since nothing uses it anymore since the command line option was removed. It is a remnant of initial development. --- blockchain/chain.go | 17 ----------------- blockchain/validate.go | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/blockchain/chain.go b/blockchain/chain.go index c9c35167..5826d100 100644 --- a/blockchain/chain.go +++ b/blockchain/chain.go @@ -105,10 +105,6 @@ type BlockChain struct { // fields in this struct below this point. chainLock sync.RWMutex - // These fields are configuration parameters that can be toggled at - // runtime. They are protected by the chain lock. - noVerify bool - // These fields are related to the memory block index. The best node // is protected by the chain lock and the index has its own locks. bestNode *blockNode @@ -174,19 +170,6 @@ type BlockChain struct { notifications []NotificationCallback } -// DisableVerify provides a mechanism to disable transaction script validation -// which you DO NOT want to do in production as it could allow double spends -// and other undesirable things. It is provided only for debug purposes since -// script validation is extremely intensive and when debugging it is sometimes -// nice to quickly get the chain. -// -// This function is safe for concurrent access. -func (b *BlockChain) DisableVerify(disable bool) { - b.chainLock.Lock() - b.noVerify = disable - b.chainLock.Unlock() -} - // HaveBlock returns whether or not the chain instance has the block represented // by the passed hash. This includes checking the various places a block can // be like part of the main chain, on a side chain, or in the orphan pool. diff --git a/blockchain/validate.go b/blockchain/validate.go index 2cfa4ca6..9ad2d2c4 100644 --- a/blockchain/validate.go +++ b/blockchain/validate.go @@ -1153,7 +1153,7 @@ func (b *BlockChain) checkConnectBlock(node *blockNode, block *btcutil.Block, vi // optimization because running the scripts is the most time consuming // portion of block handling. checkpoint := b.LatestCheckpoint() - runScripts := !b.noVerify + runScripts := true if checkpoint != nil && node.height <= checkpoint.Height { runScripts = false }