Regtest+Darksend / Dsee update / vecMasternodes

- Made masternodes/darksend compatible with regression testing mode (a local-only blockchain that doesn't require mining). Developers can now test multiple rounds in a few minutes without waiting on mining (much faster).
- Added dsee security verification to v11
- darkSendMasternodes -> vecMasternodes (must clearer)
This commit is contained in:
Evan Duffield 2014-12-30 19:54:00 -07:00
parent a290bc06f2
commit 826b18c41f
14 changed files with 507 additions and 482 deletions

View File

@ -200,7 +200,7 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C
// Update Last Seen timestamp in masternode list // Update Last Seen timestamp in masternode list
bool found = false; bool found = false;
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
//LogPrintf(" -- %s\n", mn.vin.ToString().c_str()); //LogPrintf(" -- %s\n", mn.vin.ToString().c_str());
if(mn.vin == vin) { if(mn.vin == vin) {
found = true; found = true;
@ -269,7 +269,7 @@ bool CActiveMasternode::Register(CTxIn vin, CService service, CKey keyCollateral
} }
bool found = false; bool found = false;
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) BOOST_FOREACH(CMasterNode& mn, vecMasternodes)
if(mn.vin == vin) if(mn.vin == vin)
found = true; found = true;
@ -277,7 +277,7 @@ bool CActiveMasternode::Register(CTxIn vin, CService service, CKey keyCollateral
LogPrintf("CActiveMasternode::Register() - Adding to masternode list service: %s - vin: %s\n", service.ToString().c_str(), vin.ToString().c_str()); LogPrintf("CActiveMasternode::Register() - Adding to masternode list service: %s - vin: %s\n", service.ToString().c_str(), vin.ToString().c_str());
CMasterNode mn(service, vin, pubKeyCollateralAddress, vchMasterNodeSignature, masterNodeSignatureTime, pubKeyMasternode, PROTOCOL_VERSION); CMasterNode mn(service, vin, pubKeyCollateralAddress, vchMasterNodeSignature, masterNodeSignatureTime, pubKeyMasternode, PROTOCOL_VERSION);
mn.UpdateLastSeen(masterNodeSignatureTime); mn.UpdateLastSeen(masterNodeSignatureTime);
darkSendMasterNodes.push_back(mn); vecMasternodes.push_back(mn);
} }
//send to all peers //send to all peers

View File

@ -47,7 +47,7 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
return; return;
} }
if(darkSendPool.submittedToMasternode != pfrom->addr){ if((CNetAddr)darkSendPool.submittedToMasternode != (CNetAddr)pfrom->addr){
//LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str()); //LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
return; return;
} }
@ -70,7 +70,7 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
return; return;
} }
if(darkSendPool.submittedToMasternode != pfrom->addr){ if((CNetAddr)darkSendPool.submittedToMasternode != (CNetAddr)pfrom->addr){
//LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str()); //LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
return; return;
} }
@ -118,9 +118,9 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
} }
if(darkSendPool.sessionUsers == 0) { if(darkSendPool.sessionUsers == 0) {
if(darkSendMasterNodes[mn].nLastDsq != 0 && if(vecMasternodes[mn].nLastDsq != 0 &&
darkSendMasterNodes[mn].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){ vecMasternodes[mn].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){
//LogPrintf("dsa -- last dsq too recent, must wait. %s \n", darkSendMasterNodes[mn].addr.ToString().c_str()); //LogPrintf("dsa -- last dsq too recent, must wait. %s \n", vecMasternodes[mn].addr.ToString().c_str());
std::string strError = "Last darksend was too recent"; std::string strError = "Last darksend was too recent";
pfrom->PushMessage("dssu", darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_REJECTED, strError); pfrom->PushMessage("dssu", darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_REJECTED, strError);
return; return;
@ -157,7 +157,7 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
// if the queue is ready, submit if we can // if the queue is ready, submit if we can
if(dsq.ready) { if(dsq.ready) {
if(darkSendPool.submittedToMasternode != addr){ if((CNetAddr)darkSendPool.submittedToMasternode != (CNetAddr)addr){
LogPrintf("dsq - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str()); LogPrintf("dsq - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
return; return;
} }
@ -169,16 +169,16 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
if(q.vin == dsq.vin) return; if(q.vin == dsq.vin) return;
} }
if(fDebug) LogPrintf("dsq last %d last2 %d count %d\n", darkSendMasterNodes[mn].nLastDsq, darkSendMasterNodes[mn].nLastDsq + (int)darkSendMasterNodes.size()/5, darkSendPool.nDsqCount); if(fDebug) LogPrintf("dsq last %d last2 %d count %d\n", vecMasternodes[mn].nLastDsq, vecMasternodes[mn].nLastDsq + (int)vecMasternodes.size()/5, darkSendPool.nDsqCount);
//don't allow a few nodes to dominate the queuing process //don't allow a few nodes to dominate the queuing process
if(darkSendMasterNodes[mn].nLastDsq != 0 && if(vecMasternodes[mn].nLastDsq != 0 &&
darkSendMasterNodes[mn].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){ vecMasternodes[mn].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){
if(fDebug) LogPrintf("dsq -- masternode sending too many dsq messages. %s \n", darkSendMasterNodes[mn].addr.ToString().c_str()); if(fDebug) LogPrintf("dsq -- masternode sending too many dsq messages. %s \n", vecMasternodes[mn].addr.ToString().c_str());
return; return;
} }
darkSendPool.nDsqCount++; darkSendPool.nDsqCount++;
darkSendMasterNodes[mn].nLastDsq = darkSendPool.nDsqCount; vecMasternodes[mn].nLastDsq = darkSendPool.nDsqCount;
darkSendMasterNodes[mn].allowFreeTx = true; vecMasternodes[mn].allowFreeTx = true;
if(fDebug) LogPrintf("dsq - new darksend queue object - %s\n", addr.ToString().c_str()); if(fDebug) LogPrintf("dsq - new darksend queue object - %s\n", addr.ToString().c_str());
vecDarksendQueue.push_back(dsq); vecDarksendQueue.push_back(dsq);
@ -326,7 +326,7 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream&
return; return;
} }
if(darkSendPool.submittedToMasternode != pfrom->addr){ if((CNetAddr)darkSendPool.submittedToMasternode != (CNetAddr)pfrom->addr){
//LogPrintf("dssu - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str()); //LogPrintf("dssu - message doesn't match current masternode - %s != %s\n", darkSendPool.submittedToMasternode.ToString().c_str(), pfrom->addr.ToString().c_str());
return; return;
} }
@ -1419,7 +1419,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
} }
} }
if(darkSendMasterNodes.size() == 0){ if(vecMasternodes.size() == 0){
if(fDebug) LogPrintf("CDarkSendPool::DoAutomaticDenominating - No masternodes detected\n"); if(fDebug) LogPrintf("CDarkSendPool::DoAutomaticDenominating - No masternodes detected\n");
strAutoDenomResult = "No masternodes detected"; strAutoDenomResult = "No masternodes detected";
return false; return false;
@ -1568,7 +1568,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
if(submittedToMasternode != pnode->addr) continue; if((CNetAddr)pnode->addr != (CNetAddr)submittedToMasternode) continue;
std::string strReason; std::string strReason;
if(txCollateral == CTransaction()){ if(txCollateral == CTransaction()){
@ -1599,33 +1599,33 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
// otherwise, try one randomly // otherwise, try one randomly
if(sessionTries++ < 10){ if(sessionTries++ < 10){
//pick a random masternode to use //pick a random masternode to use
int max_value = darkSendMasterNodes.size(); int max_value = vecMasternodes.size();
if(max_value <= 0) return false; if(max_value <= 0) return false;
int i = (rand() % max_value); int i = (rand() % max_value);
//don't reuse masternodes //don't reuse masternodes
BOOST_FOREACH(CTxIn usedVin, vecMasternodesUsed) { BOOST_FOREACH(CTxIn usedVin, vecMasternodesUsed) {
if(darkSendMasterNodes[i].vin == usedVin){ if(vecMasternodes[i].vin == usedVin){
return DoAutomaticDenominating(); return DoAutomaticDenominating();
} }
} }
if(darkSendMasterNodes[i].protocolVersion < MIN_PEER_PROTO_VERSION) { if(vecMasternodes[i].protocolVersion < MIN_PEER_PROTO_VERSION) {
return DoAutomaticDenominating(); return DoAutomaticDenominating();
} }
if(darkSendMasterNodes[i].nLastDsq != 0 && if(vecMasternodes[i].nLastDsq != 0 &&
darkSendMasterNodes[i].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){ vecMasternodes[i].nLastDsq + CountMasternodesAboveProtocol(darkSendPool.MIN_PEER_PROTO_VERSION)/5 > darkSendPool.nDsqCount){
return DoAutomaticDenominating(); return DoAutomaticDenominating();
} }
lastTimeChanged = GetTimeMillis(); lastTimeChanged = GetTimeMillis();
LogPrintf("DoAutomaticDenominating -- attempt %d connection to masternode %s\n", sessionTries, darkSendMasterNodes[i].addr.ToString().c_str()); LogPrintf("DoAutomaticDenominating -- attempt %d connection to masternode %s\n", sessionTries, vecMasternodes[i].addr.ToString().c_str());
if(ConnectNode((CAddress)darkSendMasterNodes[i].addr, NULL, true)){ if(ConnectNode((CAddress)vecMasternodes[i].addr, NULL, true)){
submittedToMasternode = darkSendMasterNodes[i].addr; submittedToMasternode = vecMasternodes[i].addr;
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
if(darkSendMasterNodes[i].addr != pnode->addr) continue; if((CNetAddr)pnode->addr != (CNetAddr)vecMasternodes[i].addr) continue;
std::string strReason; std::string strReason;
if(txCollateral == CTransaction()){ if(txCollateral == CTransaction()){
@ -1635,7 +1635,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
} }
} }
vecMasternodesUsed.push_back(darkSendMasterNodes[i].vin); vecMasternodesUsed.push_back(vecMasternodes[i].vin);
if(sessionMinRounds >= 0){ if(sessionMinRounds >= 0){
//use same denominations //use same denominations
@ -2120,7 +2120,7 @@ bool CDarksendQueue::Relay()
bool CDarksendQueue::CheckSignature() bool CDarksendQueue::CheckSignature()
{ {
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
if(mn.vin == vin) { if(mn.vin == vin) {
std::string strMessage = vin.ToString() + boost::lexical_cast<std::string>(nDenom) + boost::lexical_cast<std::string>(time) + boost::lexical_cast<std::string>(ready); std::string strMessage = vin.ToString() + boost::lexical_cast<std::string>(nDenom) + boost::lexical_cast<std::string>(time) + boost::lexical_cast<std::string>(ready);
@ -2155,12 +2155,12 @@ void ThreadCheckDarkSendPool()
darkSendPool.CheckTimeout(); darkSendPool.CheckTimeout();
if(c % 60 == 0){ if(c % 60 == 0){
vector<CMasterNode>::iterator it = darkSendMasterNodes.begin(); vector<CMasterNode>::iterator it = vecMasternodes.begin();
while(it != darkSendMasterNodes.end()){ while(it != vecMasternodes.end()){
(*it).Check(); (*it).Check();
if((*it).enabled == 4 || (*it).enabled == 3){ if((*it).enabled == 4 || (*it).enabled == 3){
LogPrintf("Removing inactive masternode %s\n", (*it).addr.ToString().c_str()); LogPrintf("Removing inactive masternode %s\n", (*it).addr.ToString().c_str());
it = darkSendMasterNodes.erase(it); it = vecMasternodes.erase(it);
} else { } else {
++it; ++it;
} }
@ -2200,7 +2200,7 @@ void ThreadCheckDarkSendPool()
if(c % 60 == 0){ if(c % 60 == 0){
//if we've used 1/5 of the masternode list, then clear the list. //if we've used 1/5 of the masternode list, then clear the list.
if((int)vecMasternodesUsed.size() > (int)darkSendMasterNodes.size() / 5) if((int)vecMasternodesUsed.size() > (int)vecMasternodes.size() / 5)
vecMasternodesUsed.clear(); vecMasternodesUsed.clear();
} }

View File

@ -158,7 +158,7 @@ public:
bool GetAddress(CService &addr) bool GetAddress(CService &addr)
{ {
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
if(mn.vin == vin){ if(mn.vin == vin){
addr = mn.addr; addr = mn.addr;
return true; return true;
@ -169,7 +169,7 @@ public:
bool GetProtocolVersion(int &protocolVersion) bool GetProtocolVersion(int &protocolVersion)
{ {
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
if(mn.vin == vin){ if(mn.vin == vin){
protocolVersion = mn.protocolVersion; protocolVersion = mn.protocolVersion;
return true; return true;
@ -283,7 +283,7 @@ public:
to behave themselves. If they don't it takes their money. */ to behave themselves. If they don't it takes their money. */
std::string strAddress = ""; std::string strAddress = "";
if(!(Params().NetworkID() == CChainParams::TESTNET)) { if(Params().NetworkID() == CChainParams::MAIN) {
strAddress = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF"; strAddress = "Xq19GqFvajRrEdDHYRKGYjTsQfpV5jyipF";
} else { } else {
strAddress = "y1EZuxhhNMAUofTBEeLqGE1bJrpC2TWRNp"; strAddress = "y1EZuxhhNMAUofTBEeLqGE1bJrpC2TWRNp";
@ -369,7 +369,7 @@ public:
int GetMaxPoolTransactions() int GetMaxPoolTransactions()
{ {
//if we're on testnet, just use two transactions per merge //if we're on testnet, just use two transactions per merge
if(Params().NetworkID() == CChainParams::TESTNET) return 2; if(Params().NetworkID() == CChainParams::TESTNET || Params().NetworkID() == CChainParams::REGTEST) return 2;
//use the production amount //use the production amount
return POOL_MAX_TRANSACTIONS; return POOL_MAX_TRANSACTIONS;

View File

@ -245,11 +245,11 @@ void DoConsensusVote(CTransaction& tx, bool approved, int64_t nBlockHeight)
if(n == 1){ //I'm the winner if(n == 1){ //I'm the winner
ProcessConsensusVote(ctx); ProcessConsensusVote(ctx);
} else if(n <= 10){ // not winner, but in the top10 } else if(n <= 10){ // not winner, but in the top10
if(ConnectNode((CAddress)darkSendMasterNodes[winner].addr, NULL, true)){ if(ConnectNode((CAddress)vecMasternodes[winner].addr, NULL, true)){
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
if(darkSendMasterNodes[winner].addr != pnode->addr) continue; if(vecMasternodes[winner].addr != pnode->addr) continue;
pnode->PushMessage("txlvote", ctx); pnode->PushMessage("txlvote", ctx);
LogPrintf("InstantX::DoConsensusVote --- connected, sending vote %s\n", pnode->addr.ToString().c_str()); LogPrintf("InstantX::DoConsensusVote --- connected, sending vote %s\n", pnode->addr.ToString().c_str());
@ -277,7 +277,7 @@ void ProcessConsensusVote(CConsensusVote& ctx)
} }
//We're not the winning masternode //We're not the winning masternode
if(darkSendMasterNodes[winner].vin != activeMasternode.vin) { if(vecMasternodes[winner].vin != activeMasternode.vin) {
LogPrintf("InstantX::ProcessConsensusVote - I'm not the winning masternode\n"); LogPrintf("InstantX::ProcessConsensusVote - I'm not the winning masternode\n");
return; return;
} }
@ -356,18 +356,18 @@ bool CConsensusVote::SignatureValid()
return false; return false;
} }
LogPrintf("verify addr %s \n", darkSendMasterNodes[0].addr.ToString().c_str()); LogPrintf("verify addr %s \n", vecMasternodes[0].addr.ToString().c_str());
LogPrintf("verify addr %s \n", darkSendMasterNodes[1].addr.ToString().c_str()); LogPrintf("verify addr %s \n", vecMasternodes[1].addr.ToString().c_str());
LogPrintf("verify addr %d %s \n", n, darkSendMasterNodes[n].addr.ToString().c_str()); LogPrintf("verify addr %d %s \n", n, vecMasternodes[n].addr.ToString().c_str());
CScript pubkey; CScript pubkey;
pubkey.SetDestination(darkSendMasterNodes[n].pubkey2.GetID()); pubkey.SetDestination(vecMasternodes[n].pubkey2.GetID());
CTxDestination address1; CTxDestination address1;
ExtractDestination(pubkey, address1); ExtractDestination(pubkey, address1);
CBitcoinAddress address2(address1); CBitcoinAddress address2(address1);
LogPrintf("verify pubkey2 %s \n", address2.ToString().c_str()); LogPrintf("verify pubkey2 %s \n", address2.ToString().c_str());
if(!darkSendSigner.VerifyMessage(darkSendMasterNodes[n].pubkey2, vchMasterNodeSignature, strMessage, errorMessage)) { if(!darkSendSigner.VerifyMessage(vecMasternodes[n].pubkey2, vchMasterNodeSignature, strMessage, errorMessage)) {
LogPrintf("InstantX::CConsensusVote::SignatureValid() - Verify message failed\n"); LogPrintf("InstantX::CConsensusVote::SignatureValid() - Verify message failed\n");
return false; return false;
} }

View File

@ -7,7 +7,7 @@
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
/** The list of active masternodes */ /** The list of active masternodes */
std::vector<CMasterNode> darkSendMasterNodes; std::vector<CMasterNode> vecMasternodes;
/** Object for who's going to get paid on which blocks */ /** Object for who's going to get paid on which blocks */
CMasternodePayments masternodePayments; CMasternodePayments masternodePayments;
// keep track of masternode votes I've seen // keep track of masternode votes I've seen
@ -26,7 +26,7 @@ void ProcessMasternodeConnections(){
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
//if it's our masternode, let it be //if it's our masternode, let it be
if(darkSendPool.submittedToMasternode == pnode->addr) continue; if((CNetAddr)darkSendPool.submittedToMasternode == (CNetAddr)pnode->addr) continue;
if(pnode->fDarkSendMaster){ if(pnode->fDarkSendMaster){
LogPrintf("Closing masternode connection %s \n", pnode->addr.ToString().c_str()); LogPrintf("Closing masternode connection %s \n", pnode->addr.ToString().c_str());
@ -98,11 +98,14 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
return; return;
} }
if((Params().NetworkID() == CChainParams::TESTNET && addr.GetPort() != 19999) || (!(Params().NetworkID() == CChainParams::TESTNET) && addr.GetPort() != 9999)) return; if(
(Params().NetworkID() == CChainParams::TESTNET && addr.GetPort() != 19999) ||
(Params().NetworkID() == CChainParams::REGTEST && addr.GetPort() != 19999) ||
(Params().NetworkID() == CChainParams::MAIN && addr.GetPort() != 9999)) return;
//search existing masternode list, this is where we update existing masternodes with new dsee broadcasts //search existing masternode list, this is where we update existing masternodes with new dsee broadcasts
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
if(mn.vin.prevout == vin.prevout) { if(mn.vin.prevout == vin.prevout) {
// count == -1 when it's a new entry // count == -1 when it's a new entry
// e.g. We don't want the entry relayed/time updated when we're syncing the list // e.g. We don't want the entry relayed/time updated when we're syncing the list
@ -129,12 +132,12 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
// make sure the vout that was signed is related to the transaction that spawned the masternode // make sure the vout that was signed is related to the transaction that spawned the masternode
// - this is expensive, so it's only done once per masternode // - this is expensive, so it's only done once per masternode
/* if(!darkSendSigner.IsVinAssociatedWithPubkey(vin, pubkey)) { if(!darkSendSigner.IsVinAssociatedWithPubkey(vin, pubkey)) {
LogPrintf("dsee - Got mismatched pubkey and vin\n"); LogPrintf("dsee - Got mismatched pubkey and vin\n");
Misbehaving(pfrom->GetId(), 100); Misbehaving(pfrom->GetId(), 100);
return; return;
} }
*/
if(fDebug) LogPrintf("dsee - Got NEW masternode entry %s\n", addr.ToString().c_str()); if(fDebug) LogPrintf("dsee - Got NEW masternode entry %s\n", addr.ToString().c_str());
// make sure it's still unspent // make sure it's still unspent
@ -160,7 +163,7 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
// add our masternode // add our masternode
CMasterNode mn(addr, vin, pubkey, vchSig, sigTime, pubkey2, protocolVersion); CMasterNode mn(addr, vin, pubkey, vchSig, sigTime, pubkey2, protocolVersion);
mn.UpdateLastSeen(lastUpdated); mn.UpdateLastSeen(lastUpdated);
darkSendMasterNodes.push_back(mn); vecMasternodes.push_back(mn);
// if it matches our masternodeprivkey, then we've been remotely activated // if it matches our masternodeprivkey, then we've been remotely activated
if(pubkey2 == activeMasternode.pubKeyMasternode && protocolVersion == PROTOCOL_VERSION){ if(pubkey2 == activeMasternode.pubKeyMasternode && protocolVersion == PROTOCOL_VERSION){
@ -208,7 +211,7 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
// see if we have this masternode // see if we have this masternode
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
if(mn.vin.prevout == vin.prevout) { if(mn.vin.prevout == vin.prevout) {
// LogPrintf("dseep - Found corresponding mn for vin: %s\n", vin.ToString().c_str()); // LogPrintf("dseep - Found corresponding mn for vin: %s\n", vin.ToString().c_str());
// take this only if it's newer // take this only if it's newer
@ -279,10 +282,10 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
} }
} //else, asking for a specific node which is ok } //else, asking for a specific node which is ok
int count = darkSendMasterNodes.size()-1; int count = vecMasternodes.size()-1;
int i = 0; int i = 0;
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
if(mn.addr.IsRFC1918()) continue; //local network if(mn.addr.IsRFC1918()) continue; //local network
@ -402,7 +405,7 @@ int CountMasternodesAboveProtocol(int protocolVersion)
{ {
int i = 0; int i = 0;
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
if(mn.protocolVersion < protocolVersion) continue; if(mn.protocolVersion < protocolVersion) continue;
i++; i++;
} }
@ -416,7 +419,7 @@ int GetMasternodeByVin(CTxIn& vin)
{ {
int i = 0; int i = 0;
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
if (mn.vin == vin) return i; if (mn.vin == vin) return i;
i++; i++;
} }
@ -431,7 +434,7 @@ int GetCurrentMasterNode(int mod, int64_t nBlockHeight, int minProtocol)
int winner = -1; int winner = -1;
// scan for winner // scan for winner
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
mn.Check(); mn.Check();
if(mn.protocolVersion < minProtocol) continue; if(mn.protocolVersion < minProtocol) continue;
if(!mn.IsEnabled()) { if(!mn.IsEnabled()) {
@ -462,7 +465,7 @@ int GetMasternodeByRank(int findRank, int64_t nBlockHeight, int minProtocol)
std::vector<pair<unsigned int, int> > vecMasternodeScores; std::vector<pair<unsigned int, int> > vecMasternodeScores;
i = 0; i = 0;
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
mn.Check(); mn.Check();
if(mn.protocolVersion < minProtocol) continue; if(mn.protocolVersion < minProtocol) continue;
if(!mn.IsEnabled()) { if(!mn.IsEnabled()) {
@ -493,7 +496,7 @@ int GetMasternodeRank(CTxIn& vin, int64_t nBlockHeight, int minProtocol)
{ {
std::vector<pair<unsigned int, CTxIn> > vecMasternodeScores; std::vector<pair<unsigned int, CTxIn> > vecMasternodeScores;
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
mn.Check(); mn.Check();
if(mn.protocolVersion < minProtocol) continue; if(mn.protocolVersion < minProtocol) continue;
if(!mn.IsEnabled()) { if(!mn.IsEnabled()) {
@ -608,15 +611,15 @@ void CMasterNode::Check()
bool CMasternodePayments::CheckSignature(CMasternodePaymentWinner& winner) bool CMasternodePayments::CheckSignature(CMasternodePaymentWinner& winner)
{ {
//note: need to investigate why this is failing //note: need to investigate why this is failing
/* std::string strMessage = winner.vin.ToString().c_str() + boost::lexical_cast<std::string>(winner.nBlockHeight); std::string strMessage = winner.vin.ToString().c_str() + boost::lexical_cast<std::string>(winner.nBlockHeight);
std::string strPubKey = (Params().NetworkID() == CChainParams::TESTNET) ? strTestPubKey : strMainPubKey; std::string strPubKey = (Params().NetworkID() == CChainParams::MAIN) ? strMainPubKey : strTestPubKey;
CPubKey pubkey(ParseHex(strPubKey)); CPubKey pubkey(ParseHex(strPubKey));
std::string errorMessage = ""; std::string errorMessage = "";
if(!darkSendSigner.VerifyMessage(pubkey, winner.vchSig, strMessage, errorMessage)){ if(!darkSendSigner.VerifyMessage(pubkey, winner.vchSig, strMessage, errorMessage)){
return false; return false;
} }
*/
return true; return true;
} }
@ -763,14 +766,14 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
uint256 blockHash = 0; uint256 blockHash = 0;
if(!darkSendPool.GetBlockHash(blockHash, nBlockHeight-576)) return false; if(!darkSendPool.GetBlockHash(blockHash, nBlockHeight-576)) return false;
BOOST_FOREACH(CMasterNode& mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
mn.Check(); mn.Check();
if(!mn.IsEnabled()) { if(!mn.IsEnabled()) {
continue; continue;
} }
if(LastPayment(mn) < darkSendMasterNodes.size()*.9) continue; if(LastPayment(mn) < vecMasternodes.size()*.9) continue;
uint64_t score = CalculateScore(blockHash, mn.vin); uint64_t score = CalculateScore(blockHash, mn.vin);
if(score > winner.score){ if(score > winner.score){

View File

@ -38,7 +38,7 @@ class CMasternodePayments;
using namespace std; using namespace std;
extern std::vector<CMasterNode> darkSendMasterNodes; extern std::vector<CMasterNode> vecMasternodes;
extern CMasternodePayments masternodePayments; extern CMasternodePayments masternodePayments;
extern std::vector<CTxIn> vecMasternodeAskedFor; extern std::vector<CTxIn> vecMasternodeAskedFor;
extern map<uint256, int> mapSeenMasternodeVotes; extern map<uint256, int> mapSeenMasternodeVotes;

View File

@ -170,7 +170,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
//no masternode detected //no masternode detected
int winningNode = GetCurrentMasterNode(1); int winningNode = GetCurrentMasterNode(1);
if(winningNode >= 0){ if(winningNode >= 0){
pblock->payee.SetDestination(darkSendMasterNodes[winningNode].pubkey.GetID()); pblock->payee.SetDestination(vecMasternodes[winningNode].pubkey.GetID());
} else { } else {
LogPrintf("CreateNewBlock: Failed to detect masternode to pay\n"); LogPrintf("CreateNewBlock: Failed to detect masternode to pay\n");
hasPayment = false; hasPayment = false;

View File

@ -435,7 +435,8 @@ CNode* FindNode(const CService& addr)
{ {
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
if ((CService)pnode->addr == addr) //if ((CService)pnode->addr == addr)
if((CNetAddr)pnode->addr == (CNetAddr)addr)
return (pnode); return (pnode);
return NULL; return NULL;
} }
@ -1885,7 +1886,7 @@ void RelayDarkSendIn(const std::vector<CTxIn>& in, const int64_t& nAmount, const
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)
{ {
if(darkSendPool.submittedToMasternode != pnode->addr) continue; if((CNetAddr)darkSendPool.submittedToMasternode != (CNetAddr)pnode->addr) continue;
LogPrintf("RelayDarkSendIn - found master, relaying message - %s \n", pnode->addr.ToString().c_str()); LogPrintf("RelayDarkSendIn - found master, relaying message - %s \n", pnode->addr.ToString().c_str());
pnode->PushMessage("dsi", in, nAmount, txCollateral, out); pnode->PushMessage("dsi", in, nAmount, txCollateral, out);
} }

View File

@ -110,6 +110,7 @@ class CService : public CNetAddr
unsigned short GetPort() const; unsigned short GetPort() const;
bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const; bool GetSockAddr(struct sockaddr* paddr, socklen_t *addrlen) const;
bool SetSockAddr(const struct sockaddr* paddr); bool SetSockAddr(const struct sockaddr* paddr);
friend bool operator==(const CService& a, const CService& b); friend bool operator==(const CService& a, const CService& b);
friend bool operator!=(const CService& a, const CService& b); friend bool operator!=(const CService& a, const CService& b);
friend bool operator<(const CService& a, const CService& b); friend bool operator<(const CService& a, const CService& b);

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>573</width> <width>573</width>
<height>342</height> <height>557</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -90,152 +90,152 @@
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_3"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<item> <item>
<layout class="QFormLayout" name="formLayout_2"> <layout class="QFormLayout" name="formLayout_2">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::AllNonFixedFieldsGrow</enum>
</property>
<property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Available:</string>
</property> </property>
</widget> <property name="horizontalSpacing">
<number>12</number>
</property>
<property name="verticalSpacing">
<number>12</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Available:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="labelBalance">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Your current spendable balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pending:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelUnconfirmed">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelImmatureText">
<property name="text">
<string>Immature:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelImmature">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Mined balance that has not yet matured</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelTotalText">
<property name="text">
<string>Total:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="labelTotal">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Your current total balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item> </item>
<item row="0" column="1">
<widget class="QLabel" name="labelBalance">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Your current spendable balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Pending:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="labelUnconfirmed">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Total of transactions that have yet to be confirmed, and do not yet count toward the spendable balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labelImmatureText">
<property name="text">
<string>Immature:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="labelImmature">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="toolTip">
<string>Mined balance that has not yet matured</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labelTotalText">
<property name="text">
<string>Total:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="labelTotal">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="toolTip">
<string>Your current total balance</string>
</property>
<property name="text">
<string notr="true">0 BTC</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<spacer name="horizontalSpacer_3"> <spacer name="horizontalSpacer_3">
<property name="orientation"> <property name="orientation">
@ -366,9 +366,9 @@
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="labelSubmittedDenom">
<property name="text"> <property name="text">
<string></string> <string>n/a</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -23,10 +23,17 @@
<attribute name="title"> <attribute name="title">
<string>&amp;Information</string> <string>&amp;Information</string>
</attribute> </attribute>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,1"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>12</number> <number>12</number>
</property> </property>
<item row="9" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Masternode Count</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_9"> <widget class="QLabel" name="label_9">
<property name="font"> <property name="font">
@ -40,137 +47,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Client name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="clientName">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Client version</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="clientVersion">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Using OpenSSL version</string>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="openSSLVersion">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Build date</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="buildDate">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Startup time</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="startupTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_11">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="7" column="0"> <item row="7" column="0">
<widget class="QLabel" name="label_8"> <widget class="QLabel" name="label_8">
<property name="text"> <property name="text">
@ -178,6 +54,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Client name</string>
</property>
</widget>
</item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="QLabel" name="networkName"> <widget class="QLabel" name="networkName">
<property name="cursor"> <property name="cursor">
@ -201,6 +84,189 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="15" column="0">
<widget class="QPushButton" name="openDebugLogfileButton">
<property name="toolTip">
<string>Open the Darkcoin debug log file from the current data directory. This can take a few seconds for large log files.</string>
</property>
<property name="text">
<string>&amp;Open</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="16" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Startup time</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_11">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Network</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLabel" name="numberOfBlocks">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Last block time</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="labelDebugLogfile">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Debug log file</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Using OpenSSL version</string>
</property>
<property name="indent">
<number>10</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Build date</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="openSSLVersion">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Current number of blocks</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="clientName">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="clientVersion">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QLabel" name="lastBlockTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="13" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="1"> <item row="8" column="1">
<widget class="QLabel" name="numberOfConnections"> <widget class="QLabel" name="numberOfConnections">
<property name="cursor"> <property name="cursor">
@ -217,7 +283,46 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0"> <item row="4" column="1">
<widget class="QLabel" name="buildDate">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Client version</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="startupTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_10"> <widget class="QLabel" name="label_10">
<property name="font"> <property name="font">
<font> <font>
@ -230,104 +335,13 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="10" column="0"> <item row="9" column="1">
<widget class="QLabel" name="label_3"> <widget class="QLabel" name="masternodeCount">
<property name="text">
<string>Current number of blocks</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLabel" name="numberOfBlocks">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text"> <property name="text">
<string>N/A</string> <string>N/A</string>
</property> </property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget> </widget>
</item> </item>
<item row="11" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Last block time</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QLabel" name="lastBlockTime">
<property name="cursor">
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string>N/A</string>
</property>
<property name="textFormat">
<enum>Qt::PlainText</enum>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="12" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="13" column="0">
<widget class="QLabel" name="labelDebugLogfile">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Debug log file</string>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QPushButton" name="openDebugLogfileButton">
<property name="toolTip">
<string>Open the Darkcoin debug log file from the current data directory. This can take a few seconds for large log files.</string>
</property>
<property name="text">
<string>&amp;Open</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
<item row="15" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tab_console"> <widget class="QWidget" name="tab_console">

View File

@ -411,12 +411,12 @@ void OverviewPage::darkSendStatus()
if(darkSendPool.sessionDenom == 0){ if(darkSendPool.sessionDenom == 0){
ui->label_10->setText("n/a"); ui->labelSubmittedDenom->setText("n/a");
} else { } else {
std::string out; std::string out;
darkSendPool.GetDenominationsToString(darkSendPool.sessionDenom, out); darkSendPool.GetDenominationsToString(darkSendPool.sessionDenom, out);
QString s2(out.c_str()); QString s2(out.c_str());
ui->label_10->setText(s2); ui->labelSubmittedDenom->setText(s2);
} }
showingDarkSendMessage++; showingDarkSendMessage++;

View File

@ -11,6 +11,7 @@
#include "rpcserver.h" #include "rpcserver.h"
#include "rpcclient.h" #include "rpcclient.h"
#include "masternode.h"
#include "json/json_spirit_value.h" #include "json/json_spirit_value.h"
#include <openssl/crypto.h> #include <openssl/crypto.h>
@ -372,6 +373,11 @@ void RPCConsole::setNumBlocks(int count)
ui->numberOfBlocks->setText(QString::number(count)); ui->numberOfBlocks->setText(QString::number(count));
if(clientModel) if(clientModel)
ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString()); ui->lastBlockTime->setText(clientModel->getLastBlockDate().toString());
// set masternode count
QString masternodes = QString::number((int)vecMasternodes.size());
ui->masternodeCount->setText(masternodes);
} }
void RPCConsole::on_lineEdit_returnPressed() void RPCConsole::on_lineEdit_returnPressed()

View File

@ -251,7 +251,7 @@ Value masternode(const Array& params, bool fHelp)
} }
Object obj; Object obj;
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) { BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
mn.Check(); mn.Check();
if(strCommand == "active"){ if(strCommand == "active"){
@ -278,7 +278,7 @@ Value masternode(const Array& params, bool fHelp)
} }
return obj; return obj;
} }
if (strCommand == "count") return (int)darkSendMasterNodes.size(); if (strCommand == "count") return (int)vecMasternodes.size();
if (strCommand == "start") if (strCommand == "start")
{ {
@ -455,7 +455,7 @@ Value masternode(const Array& params, bool fHelp)
{ {
int winner = GetCurrentMasterNode(1); int winner = GetCurrentMasterNode(1);
if(winner >= 0) { if(winner >= 0) {
return darkSendMasterNodes[winner].addr.ToString().c_str(); return vecMasternodes[winner].addr.ToString().c_str();
} }
return "unknown"; return "unknown";