aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bitcoinrpc.cpp2
-rw-r--r--src/main.cpp23
2 files changed, 9 insertions, 16 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index 41850d8bb8..a1e39d7506 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -176,7 +176,7 @@ Value help(const Array& params, bool fHelp)
Value stop(const Array& params, bool fHelp)
{
- // Accept the deprecated and ignored 'detach´ boolean argument
+ // Accept the deprecated and ignored 'detach' boolean argument
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
diff --git a/src/main.cpp b/src/main.cpp
index a6394e0bff..fca12b7cb8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1592,6 +1592,14 @@ bool CBlock::ConnectBlock(CBlockIndex* pindex, CCoinsViewCache &view, bool fJust
// verify that the view's current state corresponds to the previous block
assert(pindex->pprev == view.GetBestBlock());
+ // Special case for the genesis block, skipping connection of its transactions
+ // (its coinbase is unspendable)
+ if (GetHash() == hashGenesisBlock) {
+ view.SetBestBlock(pindex);
+ pindexGenesisBlock = pindex;
+ return true;
+ }
+
bool fScriptChecks = pindex->nHeight >= Checkpoints::GetTotalBlocksEstimate();
// Do not allow blocks that contain transactions which 'overwrite' older transactions,
@@ -1727,21 +1735,6 @@ bool SetBestChain(CBlockIndex* pindexNew)
// Only when all have succeeded, we push it to pcoinsTip.
CCoinsViewCache view(*pcoinsTip, true);
- // special case for attaching the genesis block
- // note that no ConnectBlock is called, so its coinbase output is non-spendable
- if (pindexGenesisBlock == NULL && pindexNew->GetBlockHash() == hashGenesisBlock)
- {
- view.SetBestBlock(pindexNew);
- if (!view.Flush())
- return false;
- pindexGenesisBlock = pindexNew;
- pindexBest = pindexNew;
- hashBestChain = pindexNew->GetBlockHash();
- nBestHeight = pindexBest->nHeight;
- bnBestChainWork = pindexNew->bnChainWork;
- return true;
- }
-
// Find the fork (typically, there is none)
CBlockIndex* pfork = view.GetBestBlock();
CBlockIndex* plonger = pindexNew;