Print the state object when ProcessSpecialTxsInBlock fails in ConnectBlock (#2516)

Currently, when any DIP2/3/6 validation fails, there is no error message
printed that shows what exactly went wrong.
This commit is contained in:
Alexander Block 2018-12-03 16:48:29 +01:00 committed by GitHub
parent 0c1b683a06
commit 0224914200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2188,8 +2188,10 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
int64_t nTime3 = GetTimeMicros(); nTimeConnect += nTime3 - nTime2; int64_t nTime3 = GetTimeMicros(); nTimeConnect += nTime3 - nTime2;
LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime3 - nTime2), 0.001 * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * 0.000001); LogPrint("bench", " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs]\n", (unsigned)block.vtx.size(), 0.001 * (nTime3 - nTime2), 0.001 * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : 0.001 * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * 0.000001);
if (!ProcessSpecialTxsInBlock(block, pindex, state)) if (!ProcessSpecialTxsInBlock(block, pindex, state)) {
return false; return error("ConnectBlock(): ProcessSpecialTxsInBlock for block %s failed with %s",
pindex->GetBlockHash().ToString(), FormatStateMessage(state));
}
// DASH : MODIFIED TO CHECK MASTERNODE PAYMENTS AND SUPERBLOCKS // DASH : MODIFIED TO CHECK MASTERNODE PAYMENTS AND SUPERBLOCKS