improvements to enforcement

This commit is contained in:
Evan Duffield 2014-09-16 10:54:40 -07:00
parent 38e0802472
commit d4f0c333fc
7 changed files with 18 additions and 57 deletions

View File

@ -474,7 +474,7 @@ Value getcheckpoint(const Array& params, bool fHelp)
result.push_back(Pair("subscribemode", IsSyncCheckpointEnforced()? "enforce" : "advisory"));
if (mapArgs.count("-checkpointkey"))
result.push_back(Pair("checkpointmaster", true));
result.push_back(Pair("enforcing", GetAdjustedTime() > enforceMasternodePaymentsTime ? "on" : "off"));
return result;
}

View File

@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 10
#define CLIENT_VERSION_REVISION 13
#define CLIENT_VERSION_BUILD 10
#define CLIENT_VERSION_BUILD 11
// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true

View File

@ -28,8 +28,6 @@ std::vector<int64> darkSendDenominations;
std::vector<CTxIn> vecMasternodeAskedFor;
/** The current darksends in progress on the network */
std::vector<CDarksendQueue> vecDarksendQueue;
/** Override masternode */
std::string strUseMasternode = "";
/* *** BEGIN DARKSEND MAGIC - DARKCOIN **********
Copyright 2014, Darkcoin Developers
@ -1047,21 +1045,6 @@ int CDarkSendPool::GetCurrentMasterNode(int mod, int64 nBlockHeight)
unsigned int score = 0;
int winner = -1;
// override the winning masternode
if(!strUseMasternode.empty()){
CService overrideAddr = CService(strUseMasternode);
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) {
if(mn.addr == overrideAddr){
LogPrintf("CDarkSendPool::GetCurrentMasterNode() - override %s\n", mn.addr.ToString().c_str());
return i;
}
i++;
}
return -1;
}
// scan for winner
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) {
mn.Check();
@ -1346,21 +1329,6 @@ int CDarkSendPool::GetMasternodeByRank(int findRank)
{
int i = 0;
// override the selected masternode
if(!strUseMasternode.empty()){
CService overrideAddr = CService(strUseMasternode);
BOOST_FOREACH(CMasterNode mn, darkSendMasterNodes) {
if(mn.addr == overrideAddr){
LogPrintf("CDarkSendPool::GetMasternodeByRank() - override %s\n", mn.addr.ToString().c_str());
return i;
}
i++;
}
return -1;
}
std::vector<pair<unsigned int, int> > vecMasternodeScores;
i = 0;

View File

@ -22,7 +22,6 @@ extern CDarkSendSigner darkSendSigner;
extern std::vector<CMasterNode> darkSendMasterNodes;
extern std::vector<int64> darkSendDenominations;
extern std::string strMasterNodePrivKey;
extern std::string strUseMasternode;
extern std::vector<CDarksendQueue> vecDarksendQueue;
extern std::vector<CTxIn> vecMasternodeAskedFor;

View File

@ -1182,9 +1182,6 @@ bool AppInit2(boost::thread_group& threadGroup)
LogPrintf("Darksend rounds %d\n", nDarksendRounds);
LogPrintf("Anonymize Darkcoin Amount %d\n", nAnonymizeDarkcoinAmount);
//override masternode
strUseMasternode = GetArg("-usemasternode", "");
darkSendDenominations.push_back( (500 * COIN)+1 );
darkSendDenominations.push_back( (100 * COIN)+1 );
darkSendDenominations.push_back( (10 * COIN)+1 );

View File

@ -4185,6 +4185,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if (pfrom->nVersion != darkSendPool.MIN_PEER_PROTO_VERSION) {
return true;
}
bool fIsInitialDownload = IsInitialBlockDownload();
if(fIsInitialDownload) return true;
@ -5266,10 +5267,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey = scriptPubKeyIn;
LogPrintf("%d\n", scriptPubKeyIn[0]);
// start masternode payments
bool bMasterNodePayment = false;
// fees to foundation
@ -5297,27 +5295,26 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
winningNode = darkSendPool.GetCurrentMasterNode(1);
if(winningNode >= 0){
payee.SetDestination(darkSendMasterNodes[winningNode].pubkey.GetID());
pblock->payee = payee;
payments++;
txNew.vout.resize(payments);
txNew.vout[payments-1].scriptPubKey = payee;
txNew.vout[payments-1].nValue = 0;
CTxDestination address1;
ExtractDestination(payee, address1);
CBitcoinAddress address2(address1);
LogPrintf("Masternode payment to %s\n", address2.ToString().c_str());
} else {
//if enforcing, then return NULL because the block will be rejected
if(pblock->MasterNodePaymentsEnforcing()) {
if(GetAdjustedTime() > enforceMasternodePaymentsTime) {
LogPrintf("CreateNewBlock: Failed to detect masternode to pay\n");
return NULL;
}
}
pblock->payee = payee;
payments++;
txNew.vout.resize(payments);
txNew.vout[payments-1].scriptPubKey = payee;
txNew.vout[payments-1].nValue = 0;
CTxDestination address1;
ExtractDestination(payee, address1);
CBitcoinAddress address2(address1);
LogPrintf("Masternode payment to %s\n", address2.ToString().c_str());
}
// Add our coinbase tx as first transaction

View File

@ -522,7 +522,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString & text)
else if (!CBitcoinAddress(text.toStdString()).IsValid())
{
ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}");
ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid Bitcoin address"));
ui->labelCoinControlChangeLabel->setText(tr("Warning: Invalid Darkcoin address"));
}
else
{