Added further diagnostic detail in case of transaction ID clash.

This commit is contained in:
Ross Nicoll 2014-08-16 14:21:13 +01:00
parent c810c931fa
commit a8cdefe23f
No known key found for this signature in database
GPG key ID: 9142E5F7E533CE3B

View file

@ -1889,9 +1889,11 @@ bool ConnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex, C
if (fEnforceBIP30) {
for (unsigned int i = 0; i < block.vtx.size(); i++) {
uint256 hash = block.GetTxHash(i);
if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned())
return state.DoS(100, error("ConnectBlock() : tried to overwrite transaction"),
if (view.HaveCoins(hash) && !view.GetCoins(hash).IsPruned()) {
std::string errorMsg = "ConnectBlock() : tried to overwrite transaction " + (hash.GetHex());
return state.DoS(100, error(errorMsg.data()),
REJECT_INVALID, "bad-txns-BIP30");
}
}
}