diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:49:25 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-23 11:49:25 +0000 |
| commit | e960802fa7149c9f997074ec7c1a7af66fb47e0f (patch) | |
| tree | c439cb6a2c9e809a8ca93e158a9dfc1175dad15a /src/rpc.cpp | |
| parent | a5300386813937e38810a86153811941047ea578 (diff) | |
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.
Diffstat (limited to 'src/rpc.cpp')
| -rw-r--r-- | src/rpc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 | |||
| 1921 | r.blockHeight, r.blockHash)) | 1921 | r.blockHeight, r.blockHash)) |
| 1922 | continue; | 1922 | continue; |
| 1923 | it->amounts.erase(r.address); | 1923 | it->amounts.erase(r.address); |
| 1924 | if (it->amounts.empty() || PayoutFullyPaid(*it)) | 1924 | // PayoutFullyPaid() returns true for an empty amounts map -- there |
| 1925 | // is no recipient in it without a txid -- so the | ||
| 1926 | // `amounts.empty()` disjunct that used to be here decided nothing. | ||
| 1927 | if (PayoutFullyPaid(*it)) | ||
| 1925 | gPendingPayouts.erase(it); | 1928 | gPendingPayouts.erase(it); |
| 1926 | break; | 1929 | break; |
| 1927 | } | 1930 | } |