mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 05:23:01 +01:00
submitted masternode tracking
This commit is contained in:
parent
dfe76916dd
commit
18e279f763
20
src/main.cpp
20
src/main.cpp
@ -3903,10 +3903,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
return false;
|
||||
}
|
||||
|
||||
int i = darkSendPool.GetCurrentMasterNode(1);
|
||||
if(i < 0) return false;
|
||||
if(darkSendMasterNodes[i].addr != pfrom->addr){
|
||||
printf("dsc - message doesn't match current masternode - %s != %s\n", darkSendMasterNodes[i].addr.ToString().c_str(), pfrom->addr.ToString().c_str());
|
||||
if(darkSendPool.submittedToMasternode != pfrom->addr){
|
||||
printf("dsc - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -4036,10 +4034,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
return false;
|
||||
}
|
||||
|
||||
int i = darkSendPool.GetCurrentMasterNode(1);
|
||||
if(i < 0) return false;
|
||||
if(darkSendMasterNodes[i].addr != pfrom->addr){
|
||||
printf("dssu - message doesn't match current masternode - %s != %s\n", darkSendMasterNodes[i].addr.ToString().c_str(), pfrom->addr.ToString().c_str());
|
||||
|
||||
if(darkSendPool.submittedToMasternode != pfrom->addr){
|
||||
printf("dssu - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -6338,6 +6335,11 @@ void CDarkSendPool::SendMoney(const CTransaction& collateral, std::vector<CTxIn>
|
||||
keypoolIndexes.push_back(index);
|
||||
}
|
||||
|
||||
int i = darkSendPool.GetCurrentMasterNode(1);
|
||||
if(i < 0) return;
|
||||
|
||||
submittedToMasternode = darkSendMasterNodes[i].addr;
|
||||
|
||||
/* BOOST_FOREACH(CTxOut& out, vout)
|
||||
out.scriptPubKey.insert(0, OP_DARKSEND);
|
||||
*/
|
||||
@ -6478,7 +6480,7 @@ bool CDarkSendPool::IsConnectedToMasterNode(){
|
||||
if(darkSendMasterNodes[i].addr == pnode->addr)
|
||||
return true;
|
||||
|
||||
if(pnode->fDarkSendMaster)
|
||||
if(darkSendPool.GetMyTransactionCount() == 0 && pnode->fDarkSendMaster)
|
||||
pnode->CloseSocketDisconnect();
|
||||
}
|
||||
|
||||
|
@ -2618,6 +2618,7 @@ public:
|
||||
std::string lastMessage;
|
||||
bool completedTransaction;
|
||||
bool unitTest;
|
||||
CService submittedToMasternode;
|
||||
|
||||
CDarkSendPool()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user