From c232806d77d74437537d3f75d9fed3b9123c8bb6 Mon Sep 17 00:00:00 2001 From: miketout Date: Tue, 13 Sep 2022 17:43:14 -0700 Subject: [PATCH] Debug output and comments --- src/miner.cpp | 4 ++-- src/pbaas/notarization.cpp | 6 ++++++ src/pbaas/reserves.h | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 6e29d167d..1613c5629 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1977,11 +1977,11 @@ CBlockTemplate* CreateNewBlock(const CChainParams& chainparams, const std::vecto mempool.removeConflicts(notarizationTx, removedTxVec); CValidationState mempoolState; relayTx = myAddtomempool(notarizationTx, &state); - if (LogAcceptCategory("notarizationverbose") || LogAcceptCategory("notarization")) + if (LogAcceptCategory("notarization")) { for (auto oneTx : removedTxVec) { - if (LogAcceptCategory("notarizationverbose")) + if (LogAcceptCategory("verbose")) { UniValue jsonNTx(UniValue::VOBJ); TxToUniv(oneTx, uint256(), jsonNTx); diff --git a/src/pbaas/notarization.cpp b/src/pbaas/notarization.cpp index 9bb8472be..486d5fe24 100644 --- a/src/pbaas/notarization.cpp +++ b/src/pbaas/notarization.cpp @@ -5332,6 +5332,12 @@ bool ValidateFinalizeNotarization(struct CCcontract_info *cp, Eval* eval, const return true; } } + if (LogAcceptCategory("notarization") && LogAcceptCategory("verbose")) + { + UniValue jsonNTx(UniValue::VOBJ); + TxToUniv(tx, uint256(), jsonNTx); + LogPrintf("%s: transaction removed from mempool due to conflicts:\n%s\n", __func__, jsonNTx.write(1,2).c_str()); + } return eval->Error("Invalid spend of confirmed finalization to transaction with no confirmed output"); } diff --git a/src/pbaas/reserves.h b/src/pbaas/reserves.h index 7436bb90c..42f61fbb1 100644 --- a/src/pbaas/reserves.h +++ b/src/pbaas/reserves.h @@ -947,6 +947,8 @@ public: CCurrencyValueMap totalAmounts; // total amount exported of each currency, including fees CCurrencyValueMap totalFees; // total fees in all currencies to split between this export and import CCurrencyValueMap totalBurned; // if this is a cross chain export, some currencies will be burned, the rest held in deposits + + // TODO: HARDENING - on next testnet reset, move this variable to before the CCurrencyValueMaps for easier parsing in the contracts CTransferDestination exporter; // typically the exporting miner or staker's address, to accept deferred payment for the export int32_t firstInput; // if export is from inputs, on chain of reserveTransfers, this is first input, -1 for cross-chain