mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
pinging master node code
This commit is contained in:
parent
a9e0c1b4b1
commit
f7ee30614f
16
src/main.cpp
16
src/main.cpp
@ -3891,14 +3891,20 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
printf("Searching existing masternodes : %s\n", vin.ToString().c_str());
|
||||
|
||||
bool found = false;
|
||||
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) {
|
||||
if(mn.vin == vin && mn.UpdatedWithin(60000)) {
|
||||
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) {
|
||||
if(mn.vin == vin) {
|
||||
found = true;
|
||||
if(!mn.UpdatedWithin(60000)){
|
||||
mn.UpdateLastSeen();
|
||||
RelayTxPoolElectionEntry(vin, addr, count, current);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("Got masternode entry\n");
|
||||
|
||||
printf("Got masternode entry\n");
|
||||
if(found) return false;
|
||||
|
||||
|
||||
CValidationState state;
|
||||
CTransaction tx = CTransaction();
|
||||
@ -5903,7 +5909,7 @@ uint256 CMasterNode::CalculateScore()
|
||||
|
||||
void CMasterNode::Check()
|
||||
{
|
||||
if(!UpdatedWithin(60000)){
|
||||
if(!UpdatedWithin(120000)){
|
||||
enabled = 0;
|
||||
return;
|
||||
}
|
||||
@ -5931,7 +5937,7 @@ void ThreadCheckDarkSendPool()
|
||||
//printf("ThreadCheckDarkSendPool::check timeout\n");
|
||||
darkSendPool.CheckTimeout();
|
||||
|
||||
if(c == 30){
|
||||
if(c == 45){
|
||||
darkSendPool.RegisterAsMasterNode();
|
||||
c = 0;
|
||||
}
|
||||
|
@ -2330,6 +2330,7 @@ public:
|
||||
|
||||
bool UpdatedWithin(int milliSeconds)
|
||||
{
|
||||
printf("UpdatedWithin %i\n", GetTimeMillis() - lastTimeSeen);
|
||||
return GetTimeMillis() - lastTimeSeen < milliSeconds;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user