From df3b2011be00d837cec64a261ee0422d9b3cea89 Mon Sep 17 00:00:00 2001 From: jamescowens Date: Tue, 16 Mar 2021 18:34:25 -0400 Subject: [PATCH] Fix another subtle error in renewal chain walker In GetNewbieSuperblockAccrualCorrection the while loop that walks the beacon chain backwards to the original advertisement has a mistake and uses beacon instead of beacon_ptr in the find. As a result it will not work for more than one renewal cycle. This is not a consensus issue, because this function is not called for beacons that have more than one renewal cycle. In fact, now that the newbie bug is out of the way, it will not be called for beacons with any renewal at all. So this is merely for correctness. --- src/gridcoin/tally.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gridcoin/tally.cpp b/src/gridcoin/tally.cpp index 21f825be3d..0e69795251 100644 --- a/src/gridcoin/tally.cpp +++ b/src/gridcoin/tally.cpp @@ -1055,7 +1055,7 @@ CAmount Tally::GetNewbieSuperblockAccrualCorrection(const Cpid& cpid, const Supe // than here. while (beacon_ptr->Renewed()) { - beacon_ptr = std::make_shared(beacons.GetBeaconDB().find(beacon->m_prev_beacon_hash)->second); + beacon_ptr = std::make_shared(beacons.GetBeaconDB().find(beacon_ptr->m_prev_beacon_hash)->second); } const CBlockIndex* pindex_baseline = GRC::Tally::GetBaseline();