@@ -1848,7 +1848,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew)
1848
1848
// an overestimation, as most will delete an existing entry or
1849
1849
// overwrite one. Still, use a conservative safety factor of 2.
1850
1850
if (!CheckDiskSpace (100 * 2 * 2 * pcoinsTip->GetCacheSize ()))
1851
- return state.Error ();
1851
+ return state.Error (" out of disk space " );
1852
1852
FlushBlockFile ();
1853
1853
pblocktree->Sync ();
1854
1854
if (!pcoinsTip->Flush ())
@@ -1924,7 +1924,7 @@ bool AddToBlockIndex(CBlock& block, CValidationState& state, const CDiskBlockPos
1924
1924
// Check for duplicate
1925
1925
uint256 hash = block.GetHash ();
1926
1926
if (mapBlockIndex.count (hash))
1927
- return state.Invalid (error (" AddToBlockIndex() : %s already exists" , hash.ToString ()));
1927
+ return state.Invalid (error (" AddToBlockIndex() : %s already exists" , hash.ToString ()), 0 , " duplicate " );
1928
1928
1929
1929
// Construct new block index object
1930
1930
CBlockIndex* pindexNew = new CBlockIndex (block);
@@ -2014,7 +2014,7 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd
2014
2014
}
2015
2015
}
2016
2016
else
2017
- return state.Error ();
2017
+ return state.Error (" out of disk space " );
2018
2018
}
2019
2019
}
2020
2020
@@ -2060,7 +2060,7 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
2060
2060
}
2061
2061
}
2062
2062
else
2063
- return state.Error ();
2063
+ return state.Error (" out of disk space " );
2064
2064
}
2065
2065
2066
2066
return true ;
@@ -2138,15 +2138,15 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CDiskBlockPos* dbp)
2138
2138
// Check for duplicate
2139
2139
uint256 hash = block.GetHash ();
2140
2140
if (mapBlockIndex.count (hash))
2141
- return state.Invalid (error (" AcceptBlock() : block already in mapBlockIndex" ));
2141
+ return state.Invalid (error (" AcceptBlock() : block already in mapBlockIndex" ), 0 , " duplicate " );
2142
2142
2143
2143
// Get prev block index
2144
2144
CBlockIndex* pindexPrev = NULL ;
2145
2145
int nHeight = 0 ;
2146
2146
if (hash != Params ().HashGenesisBlock ()) {
2147
2147
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find (block.hashPrevBlock );
2148
2148
if (mi == mapBlockIndex.end ())
2149
- return state.DoS (10 , error (" AcceptBlock() : prev block not found" ));
2149
+ return state.DoS (10 , error (" AcceptBlock() : prev block not found" ), 0 , " bad-prevblk " );
2150
2150
pindexPrev = (*mi).second ;
2151
2151
nHeight = pindexPrev->nHeight +1 ;
2152
2152
@@ -2269,9 +2269,9 @@ bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBl
2269
2269
// Check for duplicate
2270
2270
uint256 hash = pblock->GetHash ();
2271
2271
if (mapBlockIndex.count (hash))
2272
- return state.Invalid (error (" ProcessBlock() : already have block %d %s" , mapBlockIndex[hash]->nHeight , hash.ToString ()));
2272
+ return state.Invalid (error (" ProcessBlock() : already have block %d %s" , mapBlockIndex[hash]->nHeight , hash.ToString ()), 0 , " duplicate " );
2273
2273
if (mapOrphanBlocks.count (hash))
2274
- return state.Invalid (error (" ProcessBlock() : already have block (orphan) %s" , hash.ToString ()));
2274
+ return state.Invalid (error (" ProcessBlock() : already have block (orphan) %s" , hash.ToString ()), 0 , " duplicate " );
2275
2275
2276
2276
// Preliminary checks
2277
2277
if (!CheckBlock (*pblock, state))
0 commit comments