[lbry] blockchain, mining: don't flush on each new block in regtest

This commit is contained in:
Brannon King 2021-11-10 12:24:33 -05:00 committed by Roy Lee
parent d9147a4b9c
commit eb686cfa9e
2 changed files with 3 additions and 2 deletions

View file

@ -595,7 +595,8 @@ func (b *BlockChain) connectBlock(node *blockNode, block *btcutil.Block,
// Handle LBRY Claim Scripts
if b.claimTrie != nil {
if err := b.ParseClaimScripts(block, node, view, current); err != nil {
shouldFlush := current && b.chainParams.Net != wire.TestNet
if err := b.ParseClaimScripts(block, node, view, shouldFlush); err != nil {
return ruleError(ErrBadClaimTrie, err.Error())
}
}

View file

@ -638,6 +638,6 @@ func New(cfg *Config) *CPUMiner {
numWorkers: defaultNumWorkers,
updateNumWorkers: make(chan struct{}),
queryHashesPerSec: make(chan float64),
updateHashes: make(chan uint64),
updateHashes: make(chan uint64, 512),
}
}