Skip to content

Commit 4983157

Browse files
committed
Masternode: Fixing bug on the disconnection and reconnection flow, happens when the controller needs to broadcast a new start message, the remote masternode was rejecting it because thinks that already has it enabled (when the MN is in un-capable state and it was kicked from the network list), loosing the reactivation opportunity and ending in a forever non-capable state.
1 parent af01054 commit 4983157

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/masternode.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,16 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)
558558
// we are a masternode with the same vin (i.e. already activated) and this mnb is ours (matches our Masternode privkey)
559559
// so nothing to do here for us
560560
if (fMasterNode && activeMasternode.vin != nullopt &&
561-
vin.prevout == activeMasternode.vin->prevout && pubKeyMasternode == activeMasternode.pubKeyMasternode)
561+
vin.prevout == activeMasternode.vin->prevout &&
562+
pubKeyMasternode == activeMasternode.pubKeyMasternode &&
563+
activeMasternode.GetStatus() == ACTIVE_MASTERNODE_STARTED) {
562564
return true;
565+
}
563566

564567
// incorrect ping or its sigTime
565-
if(lastPing.IsNull() || !lastPing.CheckAndUpdate(nDoS, false, true)) return false;
568+
if(lastPing.IsNull() || !lastPing.CheckAndUpdate(nDoS, false, true)) {
569+
return false;
570+
}
566571

567572
// search existing Masternode list
568573
CMasternode* pmn = mnodeman.Find(vin);

0 commit comments

Comments
 (0)