From 6c088b074652fdbd69c3bc3f3fa709cb1b6be2ad Mon Sep 17 00:00:00 2001 From: Block Mechanic Date: Thu, 11 Aug 2022 13:47:29 +0200 Subject: [PATCH] Update miner.cpp --- src/miner.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index f7bed3b..5d03231 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -282,18 +282,23 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc pblock->vtx.emplace_back(); pblock->vtx[1] = MakeTransactionRef(std::move(txCoinStake)); } - + LogPrintf("%s: vtx size %d\n",__func__, pblock->vtx.size()); if(fProofOfStake && pblock->vtx.size() > 2) pblock->vtx.pop_back(); - - for (auto a: pblock->vtx) - LogPrintf("%s\n", a->ToString()); + + try { + for (auto a: pblock->vtx) + LogPrintf("%s\n", a->ToString()); + } + catch (const std::exception& e) { + return error("%s: %s", __func__, e.what()); + } pblocktemplate->vchCoinbaseCommitment = GenerateCoinbaseCommitment(*pblock, pindexPrev, chainparams.GetConsensus()); pblocktemplate->vTxFees[0] = -nFees; - + LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost); // Fill in header