Skip to content

Commit

Permalink
Fix mnp relay bug (#1700)
Browse files Browse the repository at this point in the history
* relay ping for nodes in ENABLED/EXPIRED/WATCHDOG_EXPIRED state only, skip everyone else

* typo
  • Loading branch information
UdjinM6 authored Oct 31, 2017
1 parent 673e161 commit dfb8dbb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,10 @@ bool CMasternodePing::CheckAndUpdate(CMasternode* pmn, bool fFromNewBroadcast, i
mnodeman.mapSeenMasternodeBroadcast[hash].second.lastPing = *this;
}

pmn->Check(true); // force update, ignoring cache
if (!pmn->IsEnabled()) return false;
// force update, ignoring cache
pmn->Check(true);
// relay ping for nodes in ENABLED/EXPIRED/WATCHDOG_EXPIRED state only, skip everyone else
if (!pmn->IsEnabled() && !pmn->IsExpired() && !pmn->IsWatchdogExpired()) return false;

LogPrint("masternode", "CMasternodePing::CheckAndUpdate -- Masternode ping acceepted and relayed, masternode=%s\n", vin.prevout.ToStringShort());
Relay(connman);
Expand Down

0 comments on commit dfb8dbb

Please sign in to comment.