diff --git a/src/clientversion.h b/src/clientversion.h index 3f93668a6a..0cfd40faf9 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 10 #define CLIENT_VERSION_REVISION 12 -#define CLIENT_VERSION_BUILD 13 +#define CLIENT_VERSION_BUILD 14 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/main.cpp b/src/main.cpp index 8f43eb9980..44f0e7061d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3906,7 +3906,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) int i = darkSendPool.GetCurrentMasterNode(1); if(i < 0) return false; if(darkSendMasterNodes[i].addr != pfrom->addr){ - printf("dsc - message doesn't match current masternode\n"); + printf("dsc - message doesn't match current masternode - %s != %s\n", darkSendMasterNodes[i].addr.ToString().c_str(), pfrom->addr.ToString().c_str()); return false; } @@ -4039,7 +4039,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) int i = darkSendPool.GetCurrentMasterNode(1); if(i < 0) return false; if(darkSendMasterNodes[i].addr != pfrom->addr){ - printf("dssu - message doesn't match current masternode\n"); + printf("dssu - message doesn't match current masternode - %s != %s\n", darkSendMasterNodes[i].addr.ToString().c_str(), pfrom->addr.ToString().c_str()); return false; } @@ -5995,7 +5995,7 @@ void CDarkSendPool::Check() } // better way to do this? - if(state == POOL_STATUS_FINALIZE_TRANSACTION && finalTransaction == CTransaction()) { + if(state == POOL_STATUS_FINALIZE_TRANSACTION && finalTransaction.vin.empty() && finalTransaction.vout.empty()) { if(fDebug) printf("CDarkSendPool::Check() -- FINALIZE TRANSACTIONS\n"); UpdateState(POOL_STATUS_SIGNING); @@ -6351,7 +6351,7 @@ void CDarkSendPool::SendMoney(const CTransaction& collateral, std::vector printf("CDarkSendPool::SendMoney() -- NEW INPUT -- adding %s\n", vin[0].ToString().c_str()); } - if(state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) ClearLastMessage(); + ClearLastMessage(); printf("CDarkSendPool::SendMoney() - Is connected to masternode?.\n"); @@ -6466,17 +6466,23 @@ bool CDarkSendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod return true; } + bool CDarkSendPool::IsConnectedToMasterNode(){ - bool connected = false; LOCK(cs_vNodes); + + int i = darkSendPool.GetCurrentMasterNode(1); + if(i < 0) return false; + BOOST_FOREACH(CNode* pnode, vNodes) { - if(!pnode->fDarkSendMaster) - continue; + if(darkSendMasterNodes[i].addr == pnode->addr) + return true; - connected = true; + if(pnode->fDarkSendMaster) + pnode->CloseSocketDisconnect(); } - return connected; + + return false; } void CDarkSendPool::DisconnectMasterNode(){ diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index 3ec0a31558..c73ea1bdf4 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -87,7 +87,7 @@ Value masternode(const Array& params, bool fHelp) if (fHelp || (strCommand != "start" && strCommand != "stop" && strCommand != "list" && strCommand != "count" && strCommand != "enforce" - && strCommand != "debug" && strCommand != "create" && strCommand != "current" && strCommand != "votes" && strCommand != "genkey")) + && strCommand != "debug" && strCommand != "create" && strCommand != "current" && strCommand != "votes" && strCommand != "genkey" && strCommand != "connect")) throw runtime_error( "masternode passphrase\n"); @@ -250,6 +250,25 @@ Value masternode(const Array& params, bool fHelp) return (uint64_t)enforceMasternodePaymentsTime; } + if(strCommand == "connect") + { + std::string strAddress = ""; + if (params.size() == 2){ + strAddress = params[1].get_str().c_str(); + } else { + throw runtime_error( + "Masternode address required\n"); + } + + CService addr = CService(strAddress); + + if(ConnectNode((CAddress)addr, NULL, true)){ + return "successfully connected"; + } else { + return "error connecting"; + } + } + return Value::null; }