Skip to content

Commit

Permalink
Error out in AddToBlockIndex() when a block already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
teamswipp committed Jun 21, 2020
1 parent 7b8182b commit 5028acc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2218,12 +2218,7 @@ bool CBlock::AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos, const u
uint256 hash = GetHash();

if (mapBlockIndex.count(hash))
{
// Report a soft success in the case that we are trying to save something already present.
// There's no need to error out here, which was the previous behavior.
return true;
//return error("AddToBlockIndex() : %s already exists", hash.ToString().substr(0,20).c_str());
}
return error("%s : %s already exists", __func__, hash.ToString());

// Construct new block index object
CBlockIndex* pindexNew = new CBlockIndex(nFile, nBlockPos, *this);
Expand Down

0 comments on commit 5028acc

Please sign in to comment.