From f774daf47f2562e0d1e27cdf37b6992ffa981ffc Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Fri, 17 Feb 2017 04:48:29 +0400 Subject: [PATCH] a bit more granular sync checks for mnpayment (#1344) --- src/masternode-payments.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 35a4e3619b..2ed1589b91 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -660,7 +660,7 @@ bool CMasternodePaymentVote::IsValid(CNode* pnode, int nValidationHeight, std::s if(!pmn) { strError = strprintf("Unknown Masternode: prevout=%s", vinMasternode.prevout.ToStringShort()); // Only ask if we are already synced and still have no idea about that Masternode - if(masternodeSync.IsSynced()) { + if(masternodeSync.IsMasternodeListSynced()) { mnodeman.AskForMN(pnode, vinMasternode); } @@ -772,7 +772,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) void CMasternodePaymentVote::Relay() { // do not relay until synced - if (!masternodeSync.IsSynced()) return; + if (!masternodeSync.IsWinnersListSynced()) return; CInv inv(MSG_MASTERNODE_PAYMENT_VOTE, GetHash()); RelayInv(inv); } @@ -791,7 +791,7 @@ bool CMasternodePaymentVote::CheckSignature(const CPubKey& pubKeyMasternode, int // Only ban for future block vote when we are already synced. // Otherwise it could be the case when MN which signed this vote is using another key now // and we have no idea about the old one. - if(masternodeSync.IsSynced() && nBlockHeight > nValidationHeight) { + if(masternodeSync.IsMasternodeListSynced() && nBlockHeight > nValidationHeight) { nDos = 20; } return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", vinMasternode.prevout.ToStringShort().c_str(), strError);