Permalink
Browse files

added printf of feerate and witness data into debug.log

  • Loading branch information...
0xB10C committed Apr 10, 2018
1 parent 60086dd commit 6b2ef276ceeec7f1cf64f84b5d1cd9d5be9e6d10
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/validation.cpp
@@ -351,7 +351,7 @@ bool CheckSequenceLocks(const CTransaction &tx, int flags, LockPoints* lp, bool
CBlockIndex* tip = chainActive.Tip();
assert(tip != nullptr);
CBlockIndex index;
index.pprev = tip;
// CheckSequenceLocks() uses chainActive.Height()+1 to evaluate
@@ -1897,6 +1897,8 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
blockundo.vtxundo.reserve(block.vtx.size() - 1);
std::vector<PrecomputedTransactionData> txdata;
txdata.reserve(block.vtx.size()); // Required so that pointers to individual PrecomputedTransactionData don't get invalidated
std::stringstream ssFeeratesInBlock;
std::stringstream ssHasWitnessData;
for (unsigned int i = 0; i < block.vtx.size(); i++)
{
const CTransaction &tx = *(block.vtx[i]);
@@ -1909,6 +1911,8 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
if (!Consensus::CheckTxInputs(tx, state, view, pindex->nHeight, txfee)) {
return error("%s: Consensus::CheckTxInputs: %s, %s", __func__, tx.GetHash().ToString(), FormatStateMessage(state));
}
ssFeeratesInBlock << "," << txfee / GetVirtualTransactionSize(tx);
ssHasWitnessData << "," << tx.HasWitness();
nFees += txfee;
if (!MoneyRange(nFees)) {
return state.DoS(100, error("%s: accumulated fee in the block out of range.", __func__),
@@ -1955,6 +1959,8 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
}
UpdateCoins(tx, view, i == 0 ? undoDummy : blockundo.vtxundo.back(), pindex->nHeight);
}
LogPrintf("height-fees %i%s\n", pindex->nHeight, ssFeeratesInBlock.str());
LogPrintf("height-witness %i%s\n", pindex->nHeight, ssHasWitnessData.str());
int64_t nTime3 = GetTimeMicros(); nTimeConnect += nTime3 - nTime2;
LogPrint(BCLog::BENCH, " - Connect %u transactions: %.2fms (%.3fms/tx, %.3fms/txin) [%.2fs (%.2fms/blk)]\n", (unsigned)block.vtx.size(), MILLI * (nTime3 - nTime2), MILLI * (nTime3 - nTime2) / block.vtx.size(), nInputs <= 1 ? 0 : MILLI * (nTime3 - nTime2) / (nInputs-1), nTimeConnect * MICRO, nTimeConnect * MILLI / nBlocksTotal);

0 comments on commit 6b2ef27

Please sign in to comment.