diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-06-09 12:16:15 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-06-09 12:17:12 +0200 |
| commit | 07b233a1b6e5f15ac7c8b3343088d1b2f3c8e1f1 (patch) | |
| tree | 9ddc6e0b6866df01124b48355bb65deb1fa55411 /src/miner.cpp | |
| parent | Merge pull request #4307 (diff) | |
| parent | Push cs_mains down in ProcessBlock (diff) | |
| download | discoin-07b233a1b6e5f15ac7c8b3343088d1b2f3c8e1f1.tar.xz discoin-07b233a1b6e5f15ac7c8b3343088d1b2f3c8e1f1.zip | |
Merge pull request #4148
18e7216 Push cs_mains down in ProcessBlock (Pieter Wuille)
202e019 Move all post-chaintip-change notifications to ActivateBestChain (Pieter Wuille)
4e0eed8 Allow ActivateBestChain to release its lock on cs_main (Pieter Wuille)
77339e5 Get rid of the static chainMostWork (optimization) (Pieter Wuille)
Diffstat (limited to 'src/miner.cpp')
| -rw-r--r-- | src/miner.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index ddd277a9b..baaa22c8f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -484,22 +484,22 @@ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey) LOCK(cs_main); if (pblock->hashPrevBlock != chainActive.Tip()->GetBlockHash()) return error("BitcoinMiner : generated block is stale"); + } - // Remove key from key pool - reservekey.KeepKey(); - - // Track how many getdata requests this block gets - { - LOCK(wallet.cs_wallet); - wallet.mapRequestCount[pblock->GetHash()] = 0; - } + // Remove key from key pool + reservekey.KeepKey(); - // Process this block the same as if we had received it from another node - CValidationState state; - if (!ProcessBlock(state, NULL, pblock)) - return error("BitcoinMiner : ProcessBlock, block not accepted"); + // Track how many getdata requests this block gets + { + LOCK(wallet.cs_wallet); + wallet.mapRequestCount[pblock->GetHash()] = 0; } + // Process this block the same as if we had received it from another node + CValidationState state; + if (!ProcessBlock(state, NULL, pblock)) + return error("BitcoinMiner : ProcessBlock, block not accepted"); + return true; } |