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.
This commit is contained in:
Dave Collins 2017-08-21 04:07:52 -05:00
parent 1a947c46b2
commit 991a72e34e
No known key found for this signature in database
GPG key ID: B8904D9D9C93D1F2
2 changed files with 1 additions and 18 deletions

View file

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

View file

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