From e9f292d4f0736c130e3f14ae31ee699be9fe90ad Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 3 Jul 2025 20:33:49 +0700 Subject: [PATCH] feat: improve logging of non-existing destinations for masternode payment --- src/masternode/payments.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/masternode/payments.cpp b/src/masternode/payments.cpp index b29fd3350d33..c21e90bfa16b 100644 --- a/src/masternode/payments.cpp +++ b/src/masternode/payments.cpp @@ -126,10 +126,14 @@ CAmount PlatformShare(const CAmount reward) for (const auto& txout : voutMasternodePayments) { bool found = ranges::any_of(txNew.vout, [&txout](const auto& txout2) {return txout == txout2;}); if (!found) { - CTxDestination dest; - if (!ExtractDestination(txout.scriptPubKey, dest)) - assert(false); - LogPrintf("CMNPaymentsProcessor::%s -- ERROR! Failed to find expected payee %s in block at height %s\n", __func__, EncodeDestination(dest), nBlockHeight); + std::string str_payout; + if (CTxDestination dest; ExtractDestination(txout.scriptPubKey, dest)) { + str_payout = EncodeDestination(dest); + } else { + str_payout = HexStr(txout.scriptPubKey); + } + LogPrintf("CMNPaymentsProcessor::%s -- ERROR! Failed to find expected payee %s in block at height %s\n", + __func__, str_payout, nBlockHeight); return false; } }