Skip to content

Commit 514352b

Browse files
committed
RPC/Mempool: Avoid extra decrement of unsigned below 0 when building fee histogram
1 parent 0aa11b9 commit 514352b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rpc/mempool.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,8 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool, const std::optional<MempoolHi
709709
const CAmount fee_rate{std::max(std::min(dfpb, tfpb), std::min(fpb, afpb))};
710710

711711
// Distribute fee rates
712-
for (size_t i = floors.size(); i-- > 0;) {
712+
for (size_t i = floors.size(); i > 0;) {
713+
--i;
713714
if (fee_rate >= floors[i]) {
714715
sizes[i] += size;
715716
++count[i];

0 commit comments

Comments
 (0)