From e960802fa7149c9f997074ec7c1a7af66fb47e0f Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Sun, 23 Aug 2026 11:49:25 +0000 Subject: payout: drop a disjunct in the forfeit path that decides nothing ForfeitPayoutRecipient retired an entry on `it->amounts.empty() || PayoutFullyPaid(*it)`. PayoutFullyPaid iterates amounts looking for a recipient with no txid, so it returns true for an empty map: the first test can only be true where the second already is. Left in, it reads as though the two cases differ, which invites someone to make them differ. The condition is unchanged; only the claim about it is. Property: unchanged behaviour, and the code now says only what it does. --- src/rpc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rpc.cpp b/src/rpc.cpp index a9eca8a..7b45fea 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -1921,7 +1921,10 @@ static void ForfeitPayoutRecipient(const PayingRecord& r, const std::string& rea r.blockHeight, r.blockHash)) continue; it->amounts.erase(r.address); - if (it->amounts.empty() || PayoutFullyPaid(*it)) + // PayoutFullyPaid() returns true for an empty amounts map -- there + // is no recipient in it without a txid -- so the + // `amounts.empty()` disjunct that used to be here decided nothing. + if (PayoutFullyPaid(*it)) gPendingPayouts.erase(it); break; } -- cgit v1.2.3