Merge branch 'v0.12.0.x'
This commit is contained in:
commit
c1b860bfb5
@ -200,6 +200,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage) {
|
||||
return false;
|
||||
}
|
||||
|
||||
LogPrint("masternode", "dseep - relaying from active mn, %s \n", vin.ToString().c_str());
|
||||
LOCK(cs_vNodes);
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
pnode->PushMessage("dseep", vin, vchMasterNodeSignature, masterNodeSignatureTime, false);
|
||||
|
@ -32,7 +32,7 @@ class CConsensusVote;
|
||||
class CTransaction;
|
||||
class CTransactionLock;
|
||||
|
||||
static const int MIN_INSTANTX_PROTO_VERSION = 70102;
|
||||
static const int MIN_INSTANTX_PROTO_VERSION = 70103;
|
||||
|
||||
extern map<uint256, CTransaction> mapTxLockReq;
|
||||
extern map<uint256, CTransaction> mapTxLockReqRejected;
|
||||
|
@ -1868,7 +1868,6 @@ bool CFinalizedBudget::IsValid(std::string& strError, bool fCheckCollateral)
|
||||
if(pindexPrev == NULL) return true;
|
||||
|
||||
if(nBlockStart < pindexPrev->nHeight-100) {strError = "Older than current blockHeight"; return false;}
|
||||
if(GetBlockEnd() < pindexPrev->nHeight - GetBudgetPaymentCycleBlocks()/2) {strError = "BlockEnd is older than blockHeight - cycle/2"; return false;}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class CTxBudgetPayment;
|
||||
#define VOTE_YES 1
|
||||
#define VOTE_NO 2
|
||||
|
||||
static const CAmount BUDGET_FEE_TX = (0.5*COIN);
|
||||
static const CAmount BUDGET_FEE_TX = (5*COIN);
|
||||
static const int64_t BUDGET_FEE_CONFIRMATIONS = 6;
|
||||
static const int64_t BUDGET_VOTE_UPDATE_MIN = 60*60;
|
||||
|
||||
|
@ -331,6 +331,13 @@ void CMasternodeSync::Process()
|
||||
return;
|
||||
}
|
||||
|
||||
// timeout
|
||||
if(lastBudgetItem == 0 && RequestedMasternodeAttempt >= MASTERNODE_SYNC_THRESHOLD*3) {
|
||||
GetNextAsset();
|
||||
activeMasternode.ManageStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(pnode->HasFulfilledRequest("busync")) continue;
|
||||
pnode->FulfilledRequest("busync");
|
||||
|
||||
|
@ -73,6 +73,7 @@ CMasternode::CMasternode()
|
||||
nScanningErrorCount = 0;
|
||||
nLastScanningErrorBlockHeight = 0;
|
||||
lastTimeChecked = 0;
|
||||
nLastDseep = 0;// temporary, do not save. Remove after migration to v12
|
||||
}
|
||||
|
||||
CMasternode::CMasternode(const CMasternode& other)
|
||||
@ -95,6 +96,7 @@ CMasternode::CMasternode(const CMasternode& other)
|
||||
nScanningErrorCount = other.nScanningErrorCount;
|
||||
nLastScanningErrorBlockHeight = other.nLastScanningErrorBlockHeight;
|
||||
lastTimeChecked = 0;
|
||||
nLastDseep = other.nLastDseep;// temporary, do not save. Remove after migration to v12
|
||||
}
|
||||
|
||||
CMasternode::CMasternode(const CMasternodeBroadcast& mnb)
|
||||
@ -117,6 +119,7 @@ CMasternode::CMasternode(const CMasternodeBroadcast& mnb)
|
||||
nScanningErrorCount = 0;
|
||||
nLastScanningErrorBlockHeight = 0;
|
||||
lastTimeChecked = 0;
|
||||
nLastDseep = 0;// temporary, do not save. Remove after migration to v12
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -135,6 +135,7 @@ public:
|
||||
int nLastScanningErrorBlockHeight;
|
||||
CMasternodePing lastPing;
|
||||
|
||||
int64_t nLastDseep;// temporary, do not save. Remove after migration to v12
|
||||
|
||||
CMasternode();
|
||||
CMasternode(const CMasternode& other);
|
||||
|
@ -1006,13 +1006,20 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<COutPoint, int64_t>::iterator i = mWeAskedForMasternodeListEntry.find(vin.prevout);
|
||||
if (i != mWeAskedForMasternodeListEntry.end())
|
||||
{
|
||||
int64_t t = (*i).second;
|
||||
if (GetTime() < t) return; // we've asked recently
|
||||
}
|
||||
|
||||
// see if we have this Masternode
|
||||
CMasternode* pmn = this->Find(vin);
|
||||
if(pmn != NULL && pmn->protocolVersion >= masternodePayments.GetMinMasternodePaymentsProto())
|
||||
{
|
||||
// LogPrintf("dseep - Found corresponding mn for vin: %s\n", vin.ToString().c_str());
|
||||
// take this only if it's newer
|
||||
if(sigTime - pmn->lastPing.sigTime > MASTERNODE_MIN_MNP_SECONDS)
|
||||
if(sigTime - pmn->nLastDseep > MASTERNODE_MIN_MNP_SECONDS)
|
||||
{
|
||||
std::string strMessage = pmn->addr.ToString() + boost::lexical_cast<std::string>(sigTime) + boost::lexical_cast<std::string>(stop);
|
||||
|
||||
@ -1026,10 +1033,12 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
|
||||
// fake ping for v11 masternodes, ignore for v12
|
||||
if(pmn->protocolVersion < GETHEADERS_VERSION) pmn->lastPing = CMasternodePing(vin);
|
||||
pmn->nLastDseep = sigTime;
|
||||
pmn->Check();
|
||||
if(pmn->IsEnabled()) {
|
||||
TRY_LOCK(cs_vNodes, lockNodes);
|
||||
if(!lockNodes) return;
|
||||
LogPrint("masternode", "dseep - relaying %s \n", vin.ToString().c_str());
|
||||
BOOST_FOREACH(CNode* pnode, vNodes)
|
||||
if(pnode->nVersion >= masternodePayments.GetMinMasternodePaymentsProto())
|
||||
pnode->PushMessage("dseep", vin, vchSig, sigTime, stop);
|
||||
@ -1038,7 +1047,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
return;
|
||||
}
|
||||
|
||||
LogPrint("masternode", "dseep - Couldn't find Masternode entry %s\n", vin.ToString().c_str());
|
||||
LogPrint("masternode", "dseep - Couldn't find Masternode entry %s %s\n", vin.ToString(), pfrom->addr.ToString());
|
||||
|
||||
AskForMN(pfrom, vin);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
* network protocol versioning
|
||||
*/
|
||||
|
||||
static const int PROTOCOL_VERSION = 70102;
|
||||
static const int PROTOCOL_VERSION = 70103;
|
||||
|
||||
//! initial proto version, to be increased after version/verack negotiation
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
@ -22,19 +22,19 @@ static const int GETHEADERS_VERSION = 70077;
|
||||
static const int MIN_PEER_PROTO_VERSION = 70066;
|
||||
|
||||
//! minimum peer version accepted by DarksendPool
|
||||
static const int MIN_POOL_PEER_PROTO_VERSION = 70102;
|
||||
static const int MIN_POOL_PEER_PROTO_VERSION = 70103;
|
||||
|
||||
//! minimum peer version for masternode budgets
|
||||
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70102;
|
||||
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70103;
|
||||
|
||||
//! minimum peer version for masternode winner broadcasts
|
||||
static const int MIN_MNW_PEER_PROTO_VERSION = 70102;
|
||||
static const int MIN_MNW_PEER_PROTO_VERSION = 70103;
|
||||
|
||||
//! minimum peer version that can receive masternode payments
|
||||
// V1 - Last protocol version before update
|
||||
// V2 - Newest protocol version
|
||||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_1 = 70066;
|
||||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70102;
|
||||
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70103;
|
||||
|
||||
//! nTime field added to CAddress, starting with this version;
|
||||
//! if possible, avoid requesting addresses nodes older than this
|
||||
|
Loading…
Reference in New Issue
Block a user