Merge pull request #5580

1b178a7 Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly (Luke Dashjr)
228d238 Make CCoinsViewCache's copy constructor private (Luke Dashjr)
pull/262/head
Wladimir J. van der Laan 10 years ago
commit 40d65eb66d
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

@ -437,6 +437,11 @@ public:
private: private:
CCoinsMap::iterator FetchCoins(const uint256 &txid); CCoinsMap::iterator FetchCoins(const uint256 &txid);
CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const; CCoinsMap::const_iterator FetchCoins(const uint256 &txid) const;
/**
* By making the copy constructor private, we prevent accidentally using it when one intends to create a cache on top of a base cache.
*/
CCoinsViewCache(const CCoinsViewCache &);
}; };
#endif // BITCOIN_COINS_H #endif // BITCOIN_COINS_H

@ -1718,6 +1718,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
// Special case for the genesis block, skipping connection of its transactions // Special case for the genesis block, skipping connection of its transactions
// (its coinbase is unspendable) // (its coinbase is unspendable)
if (block.GetHash() == Params().HashGenesisBlock()) { if (block.GetHash() == Params().HashGenesisBlock()) {
if (!fJustCheck)
view.SetBestBlock(pindex->GetBlockHash()); view.SetBestBlock(pindex->GetBlockHash());
return true; return true;
} }

Loading…
Cancel
Save