Skip to content

Commit

Permalink
Add expiry check to Beacon::Renewable method
Browse files Browse the repository at this point in the history
The beacon renewable method originally only checked
that the minimum amount of time has passed since the advertisement
or last renewal. This commit also adds an expiry check, as
an expired beacon cannot be successfully renewed.
  • Loading branch information
jamescowens committed Jan 15, 2024
1 parent 3f749b9 commit e5bda8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gridcoin/beacon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ bool Beacon::Expired(const int64_t now) const

bool Beacon::Renewable(const int64_t now) const
{
return Age(now) > RENEWAL_AGE;
return (!Expired(now) && Age(now) > RENEWAL_AGE);
}

bool Beacon::Renewed() const
Expand Down

0 comments on commit e5bda8c

Please sign in to comment.