Merge remote-tracking branch 'upstream/master'

This commit is contained in:
crowning- 2015-04-10 21:43:45 +02:00
commit 378fdf4c93
23 changed files with 614 additions and 1020 deletions

View File

@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 11)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 17)
define(_CLIENT_VERSION_BUILD, 22)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2015)
AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash])

View File

@ -211,7 +211,10 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C
CMasternode* pmn = mnodeman.Find(vin);
if(pmn != NULL)
{
pmn->UpdateLastSeen();
if(stop)
mnodeman.Remove(pmn->vin);
else
pmn->UpdateLastSeen();
}
else
{

View File

@ -12,7 +12,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 11
#define CLIENT_VERSION_REVISION 2
#define CLIENT_VERSION_BUILD 17
#define CLIENT_VERSION_BUILD 22

View File

@ -43,7 +43,7 @@ static const int64_t DARKSEND_POOL_MAX = (999.99*COIN);
#define MASTERNODE_EXPIRATION_SECONDS (65*60)
#define MASTERNODE_REMOVAL_SECONDS (70*60)
static const int MIN_POOL_PEER_PROTO_VERSION = 70075; // minimum peer version accepted by DarkSendPool
static const int MIN_POOL_PEER_PROTO_VERSION = 70076; // minimum peer version accepted by DarkSendPool
class CTransaction;

View File

@ -130,9 +130,6 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
}
if(state == POOL_STATUS_QUEUE){
//save the relay signature info
AddRelaySignature(dsq.vchRelaySig, dsq.nBlockHeight, dsq.strSharedKey);
if (fDebug) LogPrintf("Darksend queue is ready - %s\n", addr.ToString().c_str());
PrepareDarksendDenominate();
}
@ -158,138 +155,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
dsq.time = GetTime();
}
} else if (strCommand == "dsr") { //Darksend Relay
//* Ask a Masternode to relay an anonymous output to another Masternode *//
std::string error = "";
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
LogPrintf("dsr -- incompatible version! \n");
return;
}
if(!fMasterNode){
LogPrintf("dsr -- not a Masternode! \n");
return;
}
CDarkSendRelay dsr;
vRecv >> dsr;
if(chainActive.Tip()->nHeight - dsr.nBlockHeight > 10) return;
if(dsr.nRelayType != DARKSEND_RELAY_IN &&
dsr.nRelayType != DARKSEND_RELAY_OUT &&
dsr.nRelayType != DARKSEND_RELAY_SIG) return;
if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_IN) return;
if(dsr.out == CTxOut() && dsr.nRelayType == DARKSEND_RELAY_OUT) return;
if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_SIG) return;
CMasternode* pmn = mnodeman.Find(dsr.vinMasternode);
if(pmn == NULL){
LogPrintf("dsr -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str());
return;
}
/*
For added DDOS protection, clients can only relay through 20 nodes per block.
*/
int rank = mnodeman.GetMasternodeRank(activeMasternode.vin, dsr.nBlockHeight, MIN_POOL_PEER_PROTO_VERSION);
if(rank == -1 || rank > 20){
LogPrintf("dsr -- invalid relay Masternode! %s \n", activeMasternode.vin.ToString().c_str());
return;
}
//check the signature from the target Masternode
std::string strMessage = boost::lexical_cast<std::string>(dsr.nBlockHeight);
std::string errorMessage = "";
if(!darkSendSigner.VerifyMessage(pmn->pubkey2, dsr.vchSig, strMessage, errorMessage)){
LogPrintf("dsr - Got bad Masternode address signature\n");
Misbehaving(pfrom->GetId(), 100);
return;
}
//connect and deliver the message
if(ConnectNode((CAddress)pmn->addr, NULL, true)){
CNode* pNode = FindNode(pmn->addr);
if(pNode)
{
pNode->PushMessage("dsai", dsr);
return;
}
}
} else if (strCommand == "dsai") { //Darksend Anonymous Item (Input/Output/Sig)
std::string error = "";
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
LogPrintf("dsai -- incompatible version! \n");
return;
}
if(!fMasterNode){
LogPrintf("dsai -- not a Masternode! \n");
return;
}
CDarkSendRelay dsr;
vRecv >> dsr;
if(chainActive.Tip()->nHeight - dsr.nBlockHeight > 10) return;
if(darkSendPool.strMasternodeSharedKey == "") return;
if(dsr.nRelayType != DARKSEND_RELAY_IN &&
dsr.nRelayType != DARKSEND_RELAY_OUT &&
dsr.nRelayType != DARKSEND_RELAY_SIG) return;
if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_IN) return;
if(dsr.out == CTxOut() && dsr.nRelayType == DARKSEND_RELAY_OUT) return;
if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_SIG) return;
CMasternode* pmn = mnodeman.Find(dsr.vinMasternode);
if(pmn == NULL){
LogPrintf("dsai -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str());
return;
}
//check the signature from the target Masternode
std::string strMessage = boost::lexical_cast<std::string>(dsr.nBlockHeight);
std::string errorMessage = "";
if(!darkSendSigner.VerifyMessage(pmn->pubkey2, dsr.vchSig, strMessage, errorMessage)){
LogPrintf("dsai - Got bad Masternode address signature\n");
Misbehaving(pfrom->GetId(), 100);
return;
}
if(!dsr.VerifyMessage(darkSendPool.strMasternodeSharedKey)){
LogPrintf("dsai - Got bad shared key signature\n");
Misbehaving(pfrom->GetId(), 30);
return;
}
//do we have enough users in the current session?
if(!IsSessionReady()){
LogPrintf("dsai -- session not complete! \n");
return;
}
switch(dsr.nRelayType){
case DARKSEND_RELAY_IN:
anonTx.AddInput(dsr.in);
break;
case DARKSEND_RELAY_OUT:
anonTx.AddOutput(dsr.out);
break;
case DARKSEND_RELAY_SIG:
anonTx.AddSig(dsr.in);
break;
}
// relay to all peers that an entry was added to the pool successfully.
Check();
} else if (strCommand == "dsi") { //Darksend vIn
} else if (strCommand == "dsi") { //DarkSend vIn
std::string error = "";
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
LogPrintf("dsi -- incompatible version! \n");
@ -412,7 +278,6 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
}
} else if (strCommand == "dssu") { //Darksend status update
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
return;
}
@ -459,8 +324,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
}
if(success){
CheckFinalTransaction();
RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET);
darkSendPool.Check();
RelayStatus(darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_RESET);
}
} else if (strCommand == "dsf") { //Darksend Final tx
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
@ -617,9 +482,6 @@ void CDarksendPool::SetNull(bool clearEverything){
finalTransaction.vout.clear();
entries.clear();
anonTx.vin.clear();
anonTx.vout.clear();
nTrickleInputsOutputs = 0;
state = POOL_STATUS_IDLE;
@ -629,7 +491,6 @@ void CDarksendPool::SetNull(bool clearEverything){
lastEntryAccepted = 0;
countEntriesAccepted = 0;
lastNewBlock = 0;
fSubmitAnonymousFailed = false;
sessionUsers = 0;
sessionDenom = 0;
@ -637,18 +498,11 @@ void CDarksendPool::SetNull(bool clearEverything){
vecSessionCollateral.clear();
txCollateral = CTransaction();
vchMasternodeRelaySig.clear();
nMasternodeBlockHeight = 0;
if(clearEverything){
myEntries.clear();
sessionID = 0;
}
//automatically downgrade for 11.2, blinding will be supported in 11.3/12.0
nTrickleInputsOutputs = INT_MAX;
Downgrade();
// -- seed random number generator (used for ordering output lists)
unsigned int seed = 0;
RAND_bytes((unsigned char*)&seed, sizeof(seed));
@ -686,14 +540,10 @@ void CDarksendPool::Check()
//printf("CDarksendPool::Check() %d - %d - %d\n", state, anonTx.CountEntries(), GetTimeMillis()-lastTimeChanged);
// If entries is full, then move on to the next phase
if(state == POOL_STATUS_ACCEPTING_ENTRIES && (
(int)entries.size() >= GetMaxPoolTransactions() ||
(GetTimeMillis()-lastTimeChanged > 5000 && anonTx.CountEntries() > GetMaxPoolTransactions()*5)
))
if(state == POOL_STATUS_ACCEPTING_ENTRIES && (int)entries.size() >= GetMaxPoolTransactions())
{
if(fDebug) LogPrintf("CDarksendPool::Check() -- TRYING TRANSACTION \n");
UpdateState(POOL_STATUS_FINALIZE_TRANSACTION);
nCountAttempts++;
}
// create the finalized transaction for distribution to the clients
@ -705,26 +555,19 @@ void CDarksendPool::Check()
CTransaction txNew;
// make our new transaction
if((int)entries.size() >= GetMaxPoolTransactions()) {
for(unsigned int i = 0; i < entries.size(); i++){
BOOST_FOREACH(const CTxOut& v, entries[i].vout)
txNew.vout.push_back(v);
BOOST_FOREACH(const CTxDSIn& s, entries[i].sev)
txNew.vin.push_back(s);
}
// shuffle the outputs for improved anonymity
std::random_shuffle ( txNew.vin.begin(), txNew.vin.end(), randomizeList);
std::random_shuffle ( txNew.vout.begin(), txNew.vout.end(), randomizeList);
} else {
BOOST_FOREACH(CTxDSIn& v, anonTx.vin)
txNew.vin.push_back((CTxIn)v);
BOOST_FOREACH(CTxOut& v, anonTx.vout)
for(unsigned int i = 0; i < entries.size(); i++){
BOOST_FOREACH(const CTxOut& v, entries[i].vout)
txNew.vout.push_back(v);
BOOST_FOREACH(const CTxDSIn& s, entries[i].sev)
txNew.vin.push_back(s);
}
// shuffle the outputs for improved anonymity
std::random_shuffle ( txNew.vin.begin(), txNew.vin.end(), randomizeList);
std::random_shuffle ( txNew.vout.begin(), txNew.vout.end(), randomizeList);
if(fDebug) LogPrintf("Transaction 1: %s\n", txNew.ToString().c_str());
finalTransaction = txNew;
@ -733,8 +576,6 @@ void CDarksendPool::Check()
}
}
//printf("Signing Status %d %d\n", state == POOL_STATUS_SIGNING, SignaturesComplete());
// If we have all of the signatures, try to compile the transaction
if(state == POOL_STATUS_SIGNING && SignaturesComplete()) {
if(fDebug) LogPrintf("CDarksendPool::Check() -- SIGNING\n");
@ -764,17 +605,13 @@ void CDarksendPool::CheckFinalTransaction()
// See if the transaction is valid
if (!txNew.AcceptToMemoryPool(false))
{
if(nCountAttempts > 60) {
LogPrintf("CDarksendPool::Check() - CommitTransaction : Error: Transaction not valid\n");
SetNull();
pwalletMain->Lock();
}
LogPrintf("CDarksendPool::Check() - CommitTransaction : Error: Transaction not valid\n");
SetNull();
pwalletMain->Lock();
// not much we can do in this case]
// not much we can do in this case
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
if(!fSubmitAnonymousFailed && nCountAttempts > 30)
fSubmitAnonymousFailed = true;
RelayCompletedTransaction(sessionID, true, "Transaction not valid, please try again");
return;
}
@ -1039,24 +876,10 @@ void CDarksendPool::CheckTimeout(){
c++;
}
if(!fSubmitAnonymousFailed && !fMasterNode && state == POOL_STATUS_ACCEPTING_ENTRIES){
if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_DOWNGRADE_TIMEOUT*1000)+addLagTime){
lastTimeChanged = GetTimeMillis();
Downgrade();
}
}
if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){
lastTimeChanged = GetTimeMillis();
ChargeFees();
// reset session information for the queue query stage (before entering a Masternode, clients will send a queue request to make sure they're compatible denomination wise)
sessionUsers = 0;
sessionDenom = 0;
sessionFoundMasternode = false;
vecSessionCollateral.clear();
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
SetNull(true);
}
} else if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){
if(fDebug) LogPrintf("CDarksendPool::CheckTimeout() -- Session timed out (30s) -- resetting\n");
@ -1064,11 +887,10 @@ void CDarksendPool::CheckTimeout(){
UnlockCoins();
UpdateState(POOL_STATUS_ERROR);
lastMessage = _("Session timed out (30 seconds), please resubmit.");
lastMessage = _("Session timed out, please resubmit.");
}
if(state == POOL_STATUS_SIGNING && GetTimeMillis()-lastTimeChanged >= (DARKSEND_SIGNING_TIMEOUT*1000)+addLagTime ) {
if(fSubmitAnonymousFailed){
if(fDebug) LogPrintf("CDarksendPool::CheckTimeout() -- Session timed out -- restting\n");
ChargeFees();
SetNull();
@ -1077,13 +899,6 @@ void CDarksendPool::CheckTimeout(){
UpdateState(POOL_STATUS_ERROR);
lastMessage = _("Signing timed out, please resubmit.");
} else { //Downgrade and try again
Downgrade();
finalTransaction.vin.clear();
finalTransaction.vout.clear();
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
lastMessage = _("Downgrading and trying again.");
}
}
}
@ -1099,21 +914,13 @@ void CDarksendPool::CheckForCompleteQueue(){
// which is the active state right before merging the transaction
//
if(state == POOL_STATUS_QUEUE && sessionUsers == GetMaxPoolTransactions()) {
LogPrintf("Q ready");
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
if(strMasternodeSharedKey == ""){
CKey secret;
secret.MakeNewKey(false);
strMasternodeSharedKey = CBitcoinSecret(secret).ToString();
}
CDarksendQueue dsq;
dsq.nDenom = sessionDenom;
dsq.vin = activeMasternode.vin;
dsq.time = GetTime();
dsq.ready = true;
dsq.SetSharedKey(strMasternodeSharedKey);
dsq.Sign();
dsq.Relay();
}
@ -1271,7 +1078,7 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){
BOOST_FOREACH(const CDarkSendEntry& v, entries) {
BOOST_FOREACH(const CTxDSIn& s, v.sev){
if(s.scriptSig == newVin.scriptSig) {
LogPrintf("CDarksendPool::AddScriptSig - already exists \n");
printf("CDarksendPool::AddScriptSig - already exists \n");
return false;
}
}
@ -1288,7 +1095,12 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){
if(newVin.prevout == vin.prevout && vin.nSequence == newVin.nSequence){
vin.scriptSig = newVin.scriptSig;
vin.prevPubKey = newVin.prevPubKey;
if(fDebug) LogPrintf("CDarksendPool::AddScriptSig -- adding to finalTransaction %s\n", newVin.scriptSig.ToString().substr(0,24).c_str());
if(fDebug) LogPrintf("CDarkSendPool::AddScriptSig -- adding to finalTransaction %s\n", newVin.scriptSig.ToString().substr(0,24).c_str());
}
}
for(unsigned int i = 0; i < entries.size(); i++){
if(entries[i].AddSig(newVin)){
if(fDebug) LogPrintf("CDarkSendPool::AddScriptSig -- adding %s\n", newVin.scriptSig.ToString().substr(0,24).c_str());
return true;
}
}
@ -1299,13 +1111,6 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){
// Check to make sure everything is signed
bool CDarksendPool::SignaturesComplete(){
bool fFoundIncomplete = false;
BOOST_FOREACH(CTxDSIn in, anonTx.vin){
if(!in.fHasSig)
fFoundIncomplete = true;
}
if(fFoundIncomplete == false) return true;
BOOST_FOREACH(const CDarkSendEntry& v, entries) {
BOOST_FOREACH(const CTxDSIn& s, v.sev){
if(!s.fHasSig) return false;
@ -1388,9 +1193,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector<CTxIn>& vin, std::vector<
e.Add(vin, amount, txCollateral, vout);
myEntries.push_back(e);
// submit inputs/outputs through relays
TrickleInputsOutputs();
RelayIn(myEntries[0].sev, myEntries[0].amount, txCollateral, myEntries[0].vout);
Check();
}
@ -1448,7 +1251,6 @@ bool CDarksendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep
//
bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNode* node){
if(fMasterNode) return false;
if(fDebug) LogPrintf("CDarksendPool::SignFinalTransaction - Got Finalized Transaction - fSubmitAnonymousFailed %d\n", fSubmitAnonymousFailed);
finalTransaction = finalTransactionNew;
LogPrintf("CDarksendPool::SignFinalTransaction %s\n", finalTransaction.ToString().c_str());
@ -1473,10 +1275,6 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod
if(mine >= 0){ //might have to do this one input at a time?
//already signed
CScript scriptOld = finalTransaction.vin[mine].scriptSig;
if(!fSubmitAnonymousFailed && sigs.size() > 7) break; //send 7 each signing
int foundOutputs = 0;
int64_t nValue1 = 0;
int64_t nValue2 = 0;
@ -1498,7 +1296,7 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod
// in this case, something went wrong and we'll refuse to sign. It's possible we'll be charged collateral. But that's
// better then signing if the transaction doesn't look like what we wanted.
LogPrintf("CDarksendPool::Sign - My entries are not correct! Refusing to sign. %d entries %d target. \n", foundOutputs, targetOuputs);
TrickleInputsOutputs();
return false;
}
@ -1508,8 +1306,6 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod
// not sure what to do here, it will timeout...?
}
if(scriptOld != CScript() && finalTransaction.vin[mine].scriptSig == scriptOld) continue;
sigs.push_back(finalTransaction.vin[mine]);
if(fDebug) LogPrintf(" -- dss %d %d %s\n", mine, (int)sigs.size(), finalTransaction.vin[mine].scriptSig.ToString().c_str());
}
@ -1519,22 +1315,10 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod
if(fDebug) LogPrintf("CDarksendPool::Sign - txNew:\n%s", finalTransaction.ToString().c_str());
}
if(!fSubmitAnonymousFailed){
//resubmit some other sigs from the transaction, so nodes can't tell who's inputs/outputs are whos
BOOST_FOREACH(CTxIn& in, finalTransaction.vin)
if((rand() % 100) > 75 && in.scriptSig != CScript())
sigs.push_back(in);
// push all of our signatures to the Masternode
if(sigs.size() > 0 && node != NULL)
node->PushMessage("dss", sigs);
std::random_shuffle ( sigs.begin(), sigs.end(), randomizeList);
LogPrintf("sigs count %d\n", (int)sigs.size());
RelaySignaturesAnon(sigs);
} else {
// push all of our signatures to the Masternode
if(sigs.size() > 0 && node != NULL)
node->PushMessage("dss", sigs);
}
return true;
}
@ -1632,7 +1416,6 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
// ** find the coins we'll use
std::vector<CTxIn> vCoins;
std::vector<COutput> vCoins2;
int64_t nValueMin = CENT;
int64_t nValueIn = 0;
@ -1693,6 +1476,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
// initial phase, find a Masternode
if(!sessionFoundMasternode){
int nUseQueue = rand()%100;
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
sessionTotalValue = pwalletMain->GetTotalValue(vCoins);
@ -1708,6 +1492,14 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
return false;
}
//check our collateral
if(txCollateral != CTransaction()){
if(!IsCollateralValid(txCollateral)) {
txCollateral = CTransaction();
LogPrintf("DoAutomaticDenominating -- Invalid collateral, resetting.\n");
}
}
//don't use the queues all of the time for mixing
if(nUseQueue > 33){
@ -1733,8 +1525,10 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
}
}
std::vector<CTxIn> vTempCoins;
std::vector<COutput> vTempCoins2;
// Try to match their denominations if possible
if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vCoins, vCoins2, nValueIn, 0, nDarksendRounds)){
if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vTempCoins, vTempCoins2, nValueIn, 0, nDarksendRounds)){
LogPrintf("DoAutomaticDenominating - Couldn't match denominations %d\n", dsq.nDenom);
continue;
}
@ -1765,15 +1559,15 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
pNode->PushMessage("dsa", sessionDenom, txCollateral);
LogPrintf("DoAutomaticDenominating --- connected (from queue), sending dsa for %d %d - %s\n", sessionDenom, GetDenominationsByAmount(sessionTotalValue), pNode->addr.ToString().c_str());
strAutoDenomResult = "";
dsq.time = 0; //remove node
return true;
}
} else {
LogPrintf("DoAutomaticDenominating --- error connecting \n");
strAutoDenomResult = _("Error connecting to Masternode.");
dsq.time = 0; //remove node
return DoAutomaticDenominating();
}
dsq.time = 0; //remove node
}
}
@ -1867,90 +1661,6 @@ bool CDarksendPool::PrepareDarksendDenominate()
return false;
}
bool CDarksendPool::Downgrade()
{
if(fSubmitAnonymousFailed) return true;
if(myEntries.size() == 0) return false;
fSubmitAnonymousFailed = true;
//LogPrintf("CDarksendPool::Downgrade() : Downgrading and submitting directly\n");
// relay our entry to the master node
RelayIn(myEntries[0].sev, myEntries[0].amount, txCollateral, myEntries[0].vout);
return true;
}
struct SortByTimesSent
{
bool operator()(const CTxDSIn & t1,
const CTxDSIn & t2) const
{
return t1.nSentTimes > t2.nSentTimes;
}
bool operator()(const CTxDSOut & t1,
const CTxDSOut & t2) const
{
return t1.nSentTimes > t2.nSentTimes;
}
};
bool CDarksendPool::TrickleInputsOutputs()
{
if(nTrickleInputsOutputs >= 20) {
Downgrade();
return true;
}
if(myEntries.size() == 0) return false;
std::vector<CTxIn> vin;
std::vector<CTxOut> vout;
sort(myEntries[0].sev.rbegin(), myEntries[0].sev.rend(), SortByTimesSent());
sort(myEntries[0].vout.rbegin(), myEntries[0].vout.rend(), SortByTimesSent());
int nCount1 = 0;
int nCount2 = 0;
int nMax = max(nTrickleInputsOutputs*3, 15)+3;
//trickle some of our inputs/outputs
BOOST_FOREACH(CTxDSIn& in, myEntries[0].sev) {
if(nCount1 < (rand() % nMax)+5){
in.nSentTimes++;
vin.push_back((CTxIn)in);
nCount1++;
} else {break;}
}
BOOST_FOREACH(CTxDSOut& out, myEntries[0].vout) {
if(nCount2 < (rand() % nMax)+5){
out.nSentTimes++;
vout.push_back((CTxOut)out);
nCount2++;
} else {break;}
}
//resubmit some other inputs/outputs from the transaction, so nodes can't tell who's inputs/outputs are whos
BOOST_FOREACH(CTxIn& in, finalTransaction.vin)
if((rand() % 100) > 75)
vin.push_back(in);
BOOST_FOREACH(CTxOut& out, finalTransaction.vout)
if((rand() % 100) > 75)
vout.push_back(out);
//shuffle everything around
std::random_shuffle ( vin.begin(), vin.end(), randomizeList);
std::random_shuffle ( vout.begin(), vout.end(), randomizeList);
LogPrintf("CDarksendPool::TrickleInputsOutputs() : Sending %d inputs and %d outputs\n", (int)vin.size(), (int)vout.size());
RelayInAnon(vin, vout);
nTrickleInputsOutputs++;
return true;
}
bool CDarksendPool::SendRandomPaymentToSelf()
{
int64_t nBalance = pwalletMain->GetBalance();
@ -2099,6 +1809,8 @@ bool CDarksendPool::CreateDenominated(int64_t nTotalValue)
bool CDarksendPool::IsCompatibleWithEntries(std::vector<CTxOut>& vout)
{
if(GetDenominations(vout) == 0) return false;
BOOST_FOREACH(const CDarkSendEntry v, entries) {
LogPrintf(" IsCompatibleWithEntries %d %d\n", GetDenominations(vout), GetDenominations(v.vout));
/*
@ -2116,6 +1828,8 @@ bool CDarksendPool::IsCompatibleWithEntries(std::vector<CTxOut>& vout)
bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txCollateral, std::string& strReason)
{
if(nDenom == 0) return false;
LogPrintf("CDarksendPool::IsCompatibleWithSession - sessionDenom %d sessionUsers %d\n", sessionDenom, sessionUsers);
if (!unitTest && !IsCollateralValid(txCollateral)){
@ -2140,7 +1854,6 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla
dsq.vin = activeMasternode.vin;
dsq.time = GetTime();
dsq.Sign();
strMasternodeSharedKey = dsq.strSharedKey;
dsq.Relay();
}
@ -2149,8 +1862,8 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla
return true;
}
if((state != POOL_STATUS_IDLE && state != POOL_STATUS_QUEUE) || sessionUsers >= GetMaxPoolTransactions()){
if((state != POOL_STATUS_IDLE && state != POOL_STATUS_QUEUE)) strReason = _("Incompatible mode.");
if((state != POOL_STATUS_ACCEPTING_ENTRIES && state != POOL_STATUS_QUEUE) || sessionUsers >= GetMaxPoolTransactions()){
if((state != POOL_STATUS_ACCEPTING_ENTRIES && state != POOL_STATUS_QUEUE)) strReason = _("Incompatible mode.");
if(sessionUsers >= GetMaxPoolTransactions()) strReason = _("Masternode queue is full.");
LogPrintf("CDarksendPool::IsCompatibleWithSession - incompatible mode, return false %d %d\n", state != POOL_STATUS_ACCEPTING_ENTRIES, sessionUsers >= GetMaxPoolTransactions());
return false;
@ -2161,12 +1874,7 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla
return false;
}
if(state == POOL_STATUS_IDLE){
LogPrintf("CDarksendPool::IsCompatibleWithSession - Pool is open to new entries\n");
UpdateState(POOL_STATUS_ACCEPTING_ENTRIES);
}
LogPrintf("CDarksendPool::IsCompatibleWithSession - compatible\n");
LogPrintf("CDarkSendPool::IsCompatibleWithSession - compatible\n");
sessionUsers++;
lastTimeChanged = GetTimeMillis();
@ -2400,29 +2108,9 @@ bool CDarksendQueue::Sign()
return false;
}
// -- second signature, for proving access to the anonymous relay system
nBlockHeight = chainActive.Tip()->nHeight; //sign with our current blockheight
strMessage = boost::lexical_cast<std::string>(nBlockHeight);
if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchRelaySig, key2)) {
LogPrintf("CDarksendQueue():Relay - Sign message failed");
return false;
}
if(!darkSendSigner.VerifyMessage(pubkey2, vchRelaySig, strMessage, errorMessage)) {
LogPrintf("CDarksendQueue():Relay - Verify message failed");
return false;
}
return true;
}
void CDarksendQueue::SetSharedKey(std::string strSharedKeyIn)
{
strSharedKey = strSharedKeyIn;
}
bool CDarksendQueue::Relay()
{
@ -2448,18 +2136,6 @@ bool CDarksendQueue::CheckSignature()
return error("CDarksendQueue::CheckSignature() - Got bad Masternode address signature %s \n", vin.ToString().c_str());
}
// -- second signature, for proving access to the anonymous relay system
if(ready)
{
strMessage = boost::lexical_cast<std::string>(nBlockHeight);
if(!darkSendSigner.VerifyMessage(pmn->pubkey2, vchRelaySig, strMessage, errorMessage)) {
LogPrintf("CDarksendQueue():CheckSignature - Verify message failed");
return false;
}
}
return true;
}
@ -2476,38 +2152,6 @@ void CDarksendPool::RelayFinalTransaction(const int sessionID, const CTransactio
}
}
void CDarksendPool::RelaySignaturesAnon(std::vector<CTxIn>& vin)
{
CTxOut emptyOut;
BOOST_FOREACH(CTxIn& in, vin){
LogPrintf("RelaySignaturesAnon - sig %s\n", in.ToString().c_str());
CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_SIG, in, emptyOut);
dsr.Sign(strMasternodeSharedKey);
dsr.Relay();
}
}
void CDarksendPool::RelayInAnon(std::vector<CTxIn>& vin, std::vector<CTxOut>& vout)
{
CTxOut emptyOut;
CTxIn emptyIn;
BOOST_FOREACH(CTxIn& in, vin){
LogPrintf("RelayInAnon - in %s\n", in.ToString().c_str());
CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_IN, in, emptyOut);
dsr.Sign(strMasternodeSharedKey);
dsr.Relay();
}
BOOST_FOREACH(CTxOut& out, vout){
LogPrintf("RelayInAnon - out %s\n", out.ToString().c_str());
CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_OUT, emptyIn, out);
dsr.Sign(strMasternodeSharedKey);
dsr.Relay();
}
}
void CDarksendPool::RelayIn(const std::vector<CTxDSIn>& vin, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector<CTxDSOut>& vout)
{
@ -2544,57 +2188,6 @@ void CDarksendPool::RelayCompletedTransaction(const int sessionID, const bool er
pnode->PushMessage("dsc", sessionID, error, errorMessage);
}
bool CDSAnonTx::AddOutput(const CTxOut out){
if(fDebug) LogPrintf("CDSAnonTx::AddOutput -- new %s\n", out.ToString().substr(0,24).c_str());
BOOST_FOREACH(CTxOut& out2, vout)
if(out2.nValue == out.nValue && out.scriptPubKey == out2.scriptPubKey)
return false;
vout.push_back(out);
std::random_shuffle ( vout.begin(), vout.end(), randomizeList);
ClearSigs();
return true;
}
bool CDSAnonTx::AddInput(const CTxIn in){
if(fDebug) LogPrintf("CDSAnonTx::AddInput -- new %s\n", in.ToString().substr(0,24).c_str());
//already have this input
BOOST_FOREACH(CTxDSIn& in2, vin)
if(in2.prevout == in.prevout && in.nSequence == in2.nSequence)
return false;
vin.push_back(in);
std::random_shuffle ( vin.begin(), vin.end(), randomizeList);
ClearSigs();
return true;
}
bool CDSAnonTx::ClearSigs(){
BOOST_FOREACH(CTxDSIn& in, vin)
in.scriptSig = CScript();
return true;
}
bool CDSAnonTx::AddSig(const CTxIn newIn){
if(fDebug) LogPrintf("CDSAnonTx::AddSig -- new %s\n", newIn.ToString().substr(0,24).c_str());
BOOST_FOREACH(CTxDSIn& in, vin){
if(newIn.prevout == in.prevout && in.nSequence == newIn.nSequence){
in.scriptSig = newIn.scriptSig;
in.prevPubKey = newIn.prevPubKey;
in.fHasSig = true;
return true;
}
}
return false;
}
//TODO: Rename/move to core
void ThreadCheckDarkSendPool()
{
@ -2613,8 +2206,6 @@ void ThreadCheckDarkSendPool()
MilliSleep(1000);
//LogPrintf("ThreadCheckDarkSendPool::check timeout\n");
if(c % 10 == 0) darkSendPool.Check();
if(c % 3 == 0) darkSendPool.TrickleInputsOutputs();
darkSendPool.CheckTimeout();
darkSendPool.CheckForCompleteQueue();
@ -2668,22 +2259,8 @@ void ThreadCheckDarkSendPool()
vecMasternodesUsed.clear();
}
//auto denom every 2.5 minutes (liquidity provides try less often)
if(c % 60*(nLiquidityProvider+1) == 0){
if(nLiquidityProvider!=0){
int nRand = rand() % (101+nLiquidityProvider);
//about 1/100 chance of starting over after 4 rounds.
if(nRand == 50+nLiquidityProvider && pwalletMain->GetAverageAnonymizedRounds() > 8){
darkSendPool.SendRandomPaymentToSelf();
int nLeftToAnon = ((pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance())/COIN)-3;
if(nLeftToAnon > 999) nLeftToAnon = 999;
nAnonymizeDarkcoinAmount = (rand() % nLeftToAnon)+3;
} else {
darkSendPool.DoAutomaticDenominating();
}
} else {
darkSendPool.DoAutomaticDenominating();
}
if(darkSendPool.GetState() == POOL_STATUS_IDLE && c % 6 == 0){
darkSendPool.DoAutomaticDenominating();
}
}
}

View File

@ -39,9 +39,8 @@ class CActiveMasternode;
#define MASTERNODE_REJECTED 0
#define MASTERNODE_RESET -1
#define DARKSEND_QUEUE_TIMEOUT 180 // in seconds
#define DARKSEND_SIGNING_TIMEOUT 30 // in seconds
#define DARKSEND_DOWNGRADE_TIMEOUT 60 // in seconds
#define DARKSEND_QUEUE_TIMEOUT 30
#define DARKSEND_SIGNING_TIMEOUT 15
// used for anonymous relaying of inputs/outputs/sigs
#define DARKSEND_RELAY_IN 1
@ -73,6 +72,7 @@ public:
prevPubKey = in.prevPubKey;
nSequence = in.nSequence;
nSentTimes = 0;
fHasSig = false;
}
};
@ -92,9 +92,7 @@ public:
}
};
/** A clients transaction in the Darksend pool
* -- holds the input/output mapping for each user in the pool
*/
// A clients transaction in the darksend pool
class CDarkSendEntry
{
public:
@ -132,7 +130,22 @@ public:
return true;
}
/// Is this Darksend expired?
bool AddSig(const CTxIn& vin)
{
BOOST_FOREACH(CTxDSIn& s, sev) {
if(s.prevout == vin.prevout && s.nSequence == vin.nSequence){
if(s.fHasSig){return false;}
s.scriptSig = vin.scriptSig;
s.prevPubKey = vin.prevPubKey;
s.fHasSig = true;
return true;
}
}
return false;
}
bool IsExpired()
{
return (GetTime() - addedTime) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds
@ -152,20 +165,12 @@ public:
bool ready; //ready for submit
std::vector<unsigned char> vchSig;
//information used for the anonymous relay system
int nBlockHeight;
std::vector<unsigned char> vchRelaySig;
std::string strSharedKey; // shared key
CDarksendQueue()
{
nDenom = 0;
vin = CTxIn();
time = 0;
vchSig.clear();
vchRelaySig.clear();
nBlockHeight = 0;
strSharedKey = "";
ready = false;
}
@ -176,12 +181,6 @@ public:
READWRITE(time);
READWRITE(ready);
READWRITE(vchSig);
if(ready){
READWRITE(vchRelaySig);
READWRITE(nBlockHeight);
READWRITE(strSharedKey);
}
)
bool GetAddress(CService &addr)
@ -207,9 +206,6 @@ public:
return false;
}
/// Set the 'strSharedKey'
void SetSharedKey(std::string strSharedKey);
/** Sign this Darksend transaction
* \return true if all conditions are met:
* 1) we have an active Masternode,
@ -258,32 +254,6 @@ public:
bool VerifyMessage(CPubKey pubkey, std::vector<unsigned char>& vchSig, std::string strMessage, std::string& errorMessage);
};
/** Build a transaction anonymously
*/
class CDSAnonTx
{
public:
std::vector<CTxDSIn> vin; // collection of inputs
std::vector<CTxOut> vout; // collection of outputs
/// Is the transaction valid? (TODO: not defined - remove? or code?)
bool IsTransactionValid();
/// Add an output
bool AddOutput(const CTxOut out);
/// Add an input
bool AddInput(const CTxIn in);
/// Clear Signatures
bool ClearSigs();
/// Add Signature
bool AddSig(const CTxIn in);
/// Count the number of entries in the transaction
int CountEntries() {return (int)vin.size() + (int)vout.size();}
};
/// TODO: not defined - remove?
void ConnectToDarkSendMasterNodeWinner();
/** Used to keep track of current status of Darksend pool
*/
class CDarksendPool
@ -293,9 +263,6 @@ public:
std::vector<CDarkSendEntry> myEntries; // clients entries
std::vector<CDarkSendEntry> entries; // Masternode entries
CTransaction finalTransaction; // the finalized transaction ready for signing
CDSAnonTx anonTx; // anonymous inputs/outputs
bool fSubmitAnonymousFailed; // initally false, will change to true if when attempts > 5
int nCountAttempts; // number of submitted attempts
int64_t lastTimeChanged; // last time the 'state' changed, in UTC milliseconds
int64_t lastAutoDenomination; // TODO; not used - Delete?
@ -334,12 +301,6 @@ public:
//debugging data
std::string strAutoDenomResult;
// used for securing the anonymous relay system
vector<unsigned char> vchMasternodeRelaySig;
int nMasternodeBlockHeight;
std::string strMasternodeSharedKey;
int nTrickleInputsOutputs;
CDarksendPool()
{
/* Darksend uses collateral addresses to trust parties entering the pool
@ -351,8 +312,6 @@ public:
txCollateral = CTransaction();
minBlockSpacing = 1;
lastNewBlock = 0;
strMasternodeSharedKey = "";
nTrickleInputsOutputs = 0;
SetNull();
}
@ -390,9 +349,6 @@ public:
bool SetCollateralAddress(std::string strAddress);
void Reset();
bool Downgrade();
bool TrickleInputsOutputs();
void SetNull(bool clearEverything=false);
void UnlockCoins();
@ -492,18 +448,6 @@ public:
bool IsCollateralValid(const CTransaction& txCollateral);
/// Add a clients entry to the pool
bool AddEntry(const std::vector<CTxIn>& newInput, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector<CTxOut>& newOutput, std::string& error);
/// Add an anonymous output/inputs/sig
bool AddAnonymousOutput(const CTxOut& out) {return anonTx.AddOutput(out);}
bool AddAnonymousInput(const CTxIn& in) {return anonTx.AddInput(in);}
bool AddAnonymousSig(const CTxIn& in) {return anonTx.AddSig(in);}
bool AddRelaySignature(vector<unsigned char> vchMasternodeRelaySigIn, int nMasternodeBlockHeightIn, std::string strSharedKey) {
vchMasternodeRelaySig = vchMasternodeRelaySigIn;
nMasternodeBlockHeight = nMasternodeBlockHeightIn;
strMasternodeSharedKey = strSharedKey;
return true;
}
/// Add signature to a vin
bool AddScriptSig(const CTxIn& newVin);
/// Check that all inputs are signed. (Are all inputs signed?)

View File

@ -25,7 +25,7 @@ class CMasternodeScanningError;
extern map<uint256, CMasternodeScanningError> mapMasternodeScanningErrors;
extern CMasternodeScanning mnscan;
static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70075;
static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70076;
/*
1% of the network is scanned every 2.5 minutes, making a full

View File

@ -418,6 +418,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
if(!enabled) return false;
CMasternodePaymentWinner newWinner;
int nMinimumAge = mnodeman.CountEnabled();
CScript payeeSource;
uint256 hash;
if(!GetBlockHash(hash, nBlockHeight-10)) return false;
@ -430,8 +431,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
BOOST_REVERSE_FOREACH(CMasternodePaymentWinner& winner, vWinning)
{
//if we already have the same vin - we have one full payment cycle, break
if(vecLastPayments.size() > 0
&& std::find(vecLastPayments.begin(), vecLastPayments.end(), winner.vin) != vecLastPayments.end()) break;
if(vecLastPayments.size() > nMinimumAge) break;
vecLastPayments.push_back(winner.vin);
}
@ -439,6 +439,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
CMasternode *pmn = mnodeman.FindOldestNotInVec(vecLastPayments, nMinimumAge, 0);
if(pmn != NULL)
{
LogPrintf(" Found by FindOldestNotInVec \n");
newWinner.score = 0;
newWinner.nBlockHeight = nBlockHeight;
newWinner.vin = pmn->vin;
@ -448,11 +450,15 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
} else {
newWinner.payee.SetDestination(pmn->pubkey.GetID());
}
payeeSource.SetDestination(pmn->pubkey.GetID());
}
//if we can't find new MN to get paid, pick first active MN counting back from the end of vecLastPayments list
if(newWinner.nBlockHeight == 0 && nMinimumAge > 0)
{
LogPrintf(" Find by reverse \n");
BOOST_REVERSE_FOREACH(CTxIn& vinLP, vecLastPayments)
{
CMasternode* pmn = mnodeman.Find(vinLP);
@ -471,6 +477,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
newWinner.payee.SetDestination(pmn->pubkey.GetID());
}
payeeSource.SetDestination(pmn->pubkey.GetID());
break; // we found active MN
}
}
@ -482,7 +490,11 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
ExtractDestination(newWinner.payee, address1);
CBitcoinAddress address2(address1);
LogPrintf("Winner payee %s nHeight %d. \n", address2.ToString().c_str(), newWinner.nBlockHeight);
CTxDestination address3;
ExtractDestination(payeeSource, address3);
CBitcoinAddress address4(address3);
LogPrintf("Winner payee %s nHeight %d vin source %s. \n", address2.ToString().c_str(), newWinner.nBlockHeight, address4.ToString().c_str());
if(Sign(newWinner))
{
@ -497,6 +509,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight)
return false;
}
void CMasternodePayments::Relay(CMasternodePaymentWinner& winner)
{
CInv inv(MSG_MASTERNODE_WINNER, winner.GetHash());

View File

@ -327,12 +327,26 @@ CMasternode *CMasternodeMan::Find(const CTxIn &vin)
BOOST_FOREACH(CMasternode& mn, vMasternodes)
{
if(mn.vin == vin)
if(mn.vin.prevout == vin.prevout)
return &mn;
}
return NULL;
}
CMasternode *CMasternodeMan::Find(const CPubKey &pubKeyMasternode)
{
LOCK(cs);
BOOST_FOREACH(CMasternode& mn, vMasternodes)
{
if(mn.pubkey2 == pubKeyMasternode)
return &mn;
}
return NULL;
}
CMasternode* CMasternodeMan::FindOldestNotInVec(const std::vector<CTxIn> &vVins, int nMinimumAge, int nMinimumActiveSeconds)
{
LOCK(cs);
@ -527,20 +541,6 @@ void CMasternodeMan::ProcessMasternodeConnections()
}
}
void CMasternodeMan::RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector<unsigned char> vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, pubkey2, count, current, lastUpdated, protocolVersion, donationAddress, donationPercentage);
}
void CMasternodeMan::RelayMasternodeEntryPing(const CTxIn vin, const std::vector<unsigned char> vchSig, const int64_t nNow, const bool stop)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("dseep", vin, vchSig, nNow, stop);
}
void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
{
@ -887,6 +887,34 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
}
void CMasternodeMan::RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector<unsigned char> vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, pubkey2, count, current, lastUpdated, protocolVersion, donationAddress, donationPercentage);
}
void CMasternodeMan::RelayMasternodeEntryPing(const CTxIn vin, const std::vector<unsigned char> vchSig, const int64_t nNow, const bool stop)
{
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("dseep", vin, vchSig, nNow, stop);
}
void CMasternodeMan::Remove(CTxIn vin)
{
LOCK(cs);
vector<CMasternode>::iterator it = vMasternodes.begin();
while(it != vMasternodes.end()){
if((*it).vin == vin){
if(fDebug) LogPrintf("CMasternodeMan: Removing Masternode %s - %i now\n", (*it).addr.ToString().c_str(), size() - 1);
vMasternodes.erase(it);
break;
}
}
}
std::string CMasternodeMan::ToString() const
{
std::ostringstream info;

View File

@ -108,6 +108,7 @@ public:
/// Find an entry
CMasternode* Find(const CTxIn& vin);
CMasternode* Find(const CPubKey& pubKeyMasternode);
/// Find an entry thta do not match every entry provided vector
CMasternode* FindOldestNotInVec(const std::vector<CTxIn> &vVins, int nMinimumAge, int nMinimumActiveSeconds);
@ -124,10 +125,10 @@ public:
int GetMasternodeRank(const CTxIn &vin, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true);
CMasternode* GetMasternodeByRank(int nRank, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true);
void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
void ProcessMasternodeConnections();
void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv);
/// Return the number of (unique) Masternodes
int size() { return vMasternodes.size(); }
@ -140,6 +141,7 @@ public:
void RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector<unsigned char> vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage);
void RelayMasternodeEntryPing(const CTxIn vin, const std::vector<unsigned char> vchSig, const int64_t nNow, const bool stop);
void Remove(CTxIn vin);
};

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>576</width>
<height>400</height>
<height>402</height>
</rect>
</property>
<property name="windowTitle">
@ -148,7 +148,7 @@
<number>2</number>
</property>
<property name="maximum">
<number>18</number>
<number>8</number>
</property>
<property name="value">
<number>4</number>
@ -481,7 +481,7 @@
<attribute name="title">
<string>&amp;Display</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Display">
<layout class="QVBoxLayout" name="verticalLayout_Display">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1_Display">
<item>
@ -535,7 +535,7 @@ https://www.transifex.com/projects/p/dash/</string>
</property>
</widget>
</item>
<item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4_Display" stretch="0,0">
<item>
<widget class="QLabel" name="themeLabel">

View File

@ -1634,7 +1634,8 @@ Address: %4
<location filename="../forms/optionsdialog.ui" line="524"/>
<source>Language missing or translation incomplete? Help contributing translations here:
https://www.transifex.com/projects/p/dash/</source>
<translation type="unfinished"/>
<translation>? :
https://www.transifex.com/projects/p/dash/</translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="550"/>
@ -2417,7 +2418,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<location filename="../forms/receivecoinsdialog.ui" line="51"/>
<location filename="../forms/receivecoinsdialog.ui" line="74"/>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dash network.</source>
<translation type="unfinished"/>
<translation>注意: 这个讯息不会随着付款送到达世币网路上</translation>
</message>
<message>
<location filename="../forms/receivecoinsdialog.ui" line="54"/>
@ -4150,32 +4151,32 @@ for example: alertnotify=echo %%s | mail -s &quot;Dash Alert&quot; admin@foo.com
<message>
<location filename="../dashstrings.cpp" line="146"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
<translation>: -paytxfee </translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="149"/>
<source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Dash will not work properly.</source>
<translation type="unfinished"/>
<translation>警告: 请检查电脑日期和时间是否正确</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="152"/>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation type="unfinished"/>
<translation>警告: 达世币网路对于区块链结的决定目前有分歧</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="155"/>
<source>Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
<translation>警告: 我们和某些连线的节点对于区块链结的决定不同</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="158"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
<translation>警告: 读取钱包档wallet.dat 簿</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="161"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
<translation>警告: 钱包档wallet.dat wallet.dat %s, wallet.{timestamp}.bak. </translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="165"/>
@ -4187,7 +4188,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="170"/>
<source>You must specify a masternodeprivkey in the configuration. Please see documentation for help.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="173"/>
@ -4367,7 +4368,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="208"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="209"/>
@ -4392,7 +4393,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="213"/>
<source>Error connecting to masternode.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="214"/>
@ -4437,7 +4438,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="222"/>
<source>Error recovering public key.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="223"/>
@ -4567,7 +4568,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="248"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
<translation> blk000??.dat </translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="249"/>
@ -4897,7 +4898,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="314"/>
<source>Run a thread to flush wallet periodically (default: 1)</source>
<translation type="unfinished"/>
<translation>(默认: 1)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="315"/>
@ -4977,12 +4978,12 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="330"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
<translation>RPC (默认: 4)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="331"/>
<source>Sets the DB_PRIVATE flag in the wallet db environment (default: 1)</source>
<translation type="unfinished"/>
<translation>DB_PRIVATE (默认: 1)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="332"/>
@ -5132,7 +5133,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="361"/>
<source>Unable to sign spork message, wrong key?</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="362"/>
@ -5142,7 +5143,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="363"/>
<source>Unknown network specified in -onlynet: &apos;%s&apos;</source>
<translation type="unfinished"/>
<translation> -onlynet : &apos;%s&apos;</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="364"/>

View File

@ -4390,7 +4390,7 @@ Si el archivo no existe, créelo con permiso de lectura solamente del propietari
<message>
<location filename="../dashstrings.cpp" line="210"/>
<source>Downgrading and trying again.</source>
<translation type="unfinished"/>
<translation>Descargando e intentando de nuevo.</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="211"/>

View File

@ -33,7 +33,7 @@ Levitetään MIT/X11 ohjelmistolisenssin alaisuudessa. Tarkemmat tiedot löytyv
Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.openssl.org/), Eric Youngin (eay@cryptsoft.com) kehittämän salausohjelmiston sekä Thomas Bernardin UPnP ohjelmiston.
Käännös päivitetty: 29.3.2015 by AjM.</translation>
Käännös päivitetty: 7.4.2015 by AjM.</translation>
</message>
<message>
<location filename="../utilitydialog.cpp" line="30"/>
@ -279,8 +279,7 @@ Käännös päivitetty: 29.3.2015 by AjM.</translation>
<message>
<location filename="../askpassphrasedialog.cpp" line="113"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR DASH&lt;/b&gt;!</source>
<translation>Varoitus: Jos salaat lompakon ja unohdat salasanan,
&lt;b&gt;MENETÄT KAIKKI DASHISI&lt;/b&gt;!</translation>
<translation>Varoitus: Jos salaat lompakon ja unohdat salasanan, &lt;b&gt;MENETÄT KAIKKI DASHisi&lt;/b&gt;!</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="113"/>
@ -296,7 +295,7 @@ Käännös päivitetty: 29.3.2015 by AjM.</translation>
<message>
<location filename="../askpassphrasedialog.cpp" line="124"/>
<source>Dash will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your dashs from being stolen by malware infecting your computer.</source>
<translation>Dash sulkeutuu nyt salauksen viimeistelyä varten. Muista että salaus pelkästään ei voi estää dashiesi varastamista jos koneesi saastuu haittaohjelmilla tai viruksilla.</translation>
<translation>Dash sulkeutuu nyt salauksen viimeistelyä varten. Muista että salaus pelkästään ei voi estää Dashiesi varastamista jos koneesi saastuu haittaohjelmilla tai viruksilla.</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="128"/>
@ -1775,7 +1774,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/overviewpage.ui" line="178"/>
<source>Immature:</source>
<translation>Vahvistamatta:</translation>
<translation>Kypsymättä:</translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="191"/>
@ -1883,7 +1882,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/overviewpage.ui" line="1014"/>
<source>&lt;b&gt;Recent transactions&lt;/b&gt;</source>
<translation>&lt;b&gt;Viimeisimmät tapahtumat&lt;/b&gt;</translation>
<translation>&lt;b&gt;Uusimmat tapahtumat&lt;/b&gt;</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="126"/>
@ -2067,7 +2066,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../paymentserver.cpp" line="294"/>
<source>Cannot start dash: click-to-pay handler</source>
<translation>Ei voi käynnistää dashia: click-to-pay handler</translation>
<translation>Ei voi käynnistää Dashia: click-to-pay handler</translation>
</message>
<message>
<location filename="../paymentserver.cpp" line="352"/>
@ -2987,7 +2986,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/sendcoinsentry.ui" line="157"/>
<source>A message that was attached to the dash: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Dash network.</source>
<translation>Viesti joka liitettiin dash: URI joka talletetaan siirtotapahtuman kanssa viitteeksi sinulle. Huomio: Tätä viestiä ei lähetetä Dash verkkoon.</translation>
<translation>Viesti joka liitettiin Dash: URI joka talletetaan siirtotapahtuman kanssa viitteeksi sinulle. Huomio: Tätä viestiä ei lähetetä Dash verkkoon.</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="583"/>
@ -3027,7 +3026,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../utilitydialog.cpp" line="130"/>
<source>Do not shut down the computer until this window disappears.</source>
<translation>Ä sammuta tietokonetta ennenkuin tämä ikkuna katoaa.</translation>
<translation>Ä sammuta tietokonetta ennen kuin tämä ikkuna katoaa.</translation>
</message>
</context>
<context>
@ -3540,7 +3539,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../transactiontablemodel.cpp" line="297"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Vahvistetaan (%1 kehoitetusta %2 vahvistuksesta)</translation>
<translation>Vahvistetaan (%1 / %2 vahvistusta)</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="300"/>
@ -4436,7 +4435,7 @@ Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin.</tran
<message>
<location filename="../dashstrings.cpp" line="219"/>
<source>Error loading wallet.dat: Wallet requires newer version of Dash</source>
<translation>Virhe ladattaessa wallet.dat lompakkotiedostoa: Tarvitset uudemman version dashista</translation>
<translation>Virhe ladattaessa wallet.dat lompakkotiedostoa: Tarvitset uudemman version Dashista</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="220"/>
@ -4686,7 +4685,7 @@ Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin.</tran
<message>
<location filename="../dashstrings.cpp" line="269"/>
<source>Keep N dash anonymized (default: 0)</source>
<translation>Pidä N dashia anonymisoituna (default: 0)</translation>
<translation>Pidä N Dashia anonymisoituna (default: 0)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="270"/>

View File

@ -16,7 +16,7 @@
<source>Copyright &amp;copy; 2009-2014 The Bitcoin Core developers.
Copyright &amp;copy; 2014-YYYY The Dash Core developers.</source>
<translation>Upphovsrätt &amp;kopia: 2009 - 2015 Bitcoin Core-utvecklarna.
Upphovsrätt &amp;kopia; 2014 - YYYY Dash Core, utvecklarna.</translation>
Upphovsrätt &amp;kopia; 2014 - YYYY Dash Core-utvecklarna.</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="111"/>
@ -4405,7 +4405,7 @@ Om filen inte existerar, skapa den och ge inga andra än ägaren läsarrättighe
</message>
<message>
<location filename="../dashstrings.cpp" line="213"/>
<source>Error connecting to Masternode.</source>
<source>Error connecting to masternode.</source>
<translation>Fel vid anslutning till masternode.</translation>
</message>
<message>
@ -4736,7 +4736,7 @@ Om filen inte existerar, skapa den och ge inga andra än ägaren läsarrättighe
<message>
<location filename="../dashstrings.cpp" line="279"/>
<source>Loading masternode list...</source>
<translation type="unfinished"/>
<translation>Laddar masternode-listan.</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="280"/>

File diff suppressed because it is too large Load Diff

View File

@ -4,19 +4,19 @@
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="53"/>
<source>&lt;b&gt;Dash Core&lt;/b&gt; version</source>
<translation>&lt;b&gt;&lt;/b&gt; </translation>
<translation>&lt;b&gt;&lt;/b&gt; </translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="94"/>
<source>Copyright &amp;copy; 2009-2014 The Bitcoin Core developers.
Copyright &amp;copy; 2014-YYYY The Dash Core developers.</source>
<translation> &amp;copy 西 2009-2014
&amp;copy 西 2014-YYYY年所有</translation>
&amp;copy 西 2014-YYYY年所有</translation>
</message>
<message>
<location filename="../forms/aboutdialog.ui" line="111"/>
@ -49,7 +49,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../utilitydialog.cpp" line="31"/>
<source>The Dash Core developers</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../utilitydialog.cpp" line="43"/>
@ -138,12 +138,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../addressbookpage.cpp" line="65"/>
<source>These are your Dash addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="69"/>
<source>These are your Dash addresses for receiving payments. It is recommended to use a new receiving address for each transaction.</source>
<translation>使</translation>
<translation>使</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="75"/>
@ -278,8 +278,8 @@ This product includes software developed by the OpenSSL Project for use in the O
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="113"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR DARKCOINS&lt;/b&gt;!</source>
<translation>警告:如果把錢包加密後又忘記密碼&lt;b&gt;&lt;/b&gt;!</translation>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR DASH&lt;/b&gt;!</source>
<translation>警告:如果把錢包加密後又忘記密碼&lt;b&gt;&lt;/b&gt;!</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="113"/>
@ -295,7 +295,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../askpassphrasedialog.cpp" line="124"/>
<source>Dash will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your dashs from being stolen by malware infecting your computer.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="128"/>
@ -355,7 +355,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="76"/>
<source>Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="85"/>
@ -391,7 +391,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="235"/>
<source>Send coins to a Dash address</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="241"/>
@ -401,7 +401,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="242"/>
<source>Request payments (generates QR codes and dash: URIs)</source>
<translation>( URI)</translation>
<translation>( URI)</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="248"/>
@ -427,12 +427,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<location filename="../bitcoingui.cpp" line="271"/>
<location filename="../bitcoingui.cpp" line="273"/>
<source>&amp;About Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="274"/>
<source>Show information about Dash</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="277"/>
@ -453,7 +453,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="284"/>
<source>Modify configuration options for Dash</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="287"/>
@ -519,7 +519,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="303"/>
<source>Sign messages with your Dash addresses to prove you own them</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="304"/>
@ -529,7 +529,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="305"/>
<source>Verify messages to ensure they were signed with specified Dash addresses</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="307"/>
@ -599,7 +599,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="322"/>
<source>Open a dash: URI or payment request</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="324"/>
@ -609,7 +609,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="325"/>
<source>Show the Dash Core help message to get a list with possible Dash command-line options</source>
<translation>使</translation>
<translation>使</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="361"/>
@ -640,12 +640,12 @@ This product includes software developed by the OpenSSL Project for use in the O
<location filename="../bitcoingui.cpp" line="493"/>
<location filename="../bitcoingui.cpp" line="498"/>
<source>Dash client</source>
<translation></translation>
<translation></translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="643"/>
<source>%n active connection(s) to Dash network</source>
<translation><numerusform>%n </numerusform></translation>
<translation><numerusform>%n </numerusform></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="655"/>
@ -726,7 +726,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../bitcoingui.cpp" line="755"/>
<source>Dash</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="769"/>
@ -784,7 +784,7 @@ Address: %4
<message>
<location filename="../dash.cpp" line="449"/>
<source>A fatal error occurred. Dash can no longer continue safely and will quit.</source>
<translation>退</translation>
<translation>退</translation>
</message>
</context>
<context>
@ -1181,17 +1181,17 @@ Address: %4
<message>
<location filename="../darksendconfig.cpp" line="44"/>
<source>Darksend was successfully set to basic (%1 and 2 rounds). You can change this at any time by opening Dash&apos;s configuration screen.</source>
<translation>(%12)</translation>
<translation>(%12)</translation>
</message>
<message>
<location filename="../darksendconfig.cpp" line="59"/>
<source>Darksend was successfully set to high (%1 and 8 rounds). You can change this at any time by opening Dash&apos;s configuration screen.</source>
<translation>(%18)</translation>
<translation>(%18)</translation>
</message>
<message>
<location filename="../darksendconfig.cpp" line="74"/>
<source>Darksend was successfully set to maximum (%1 and 16 rounds). You can change this at any time by opening Dash&apos;s configuration screen.</source>
<translation>(%116)</translation>
<translation>(%116)</translation>
</message>
</context>
<context>
@ -1244,7 +1244,7 @@ Address: %4
<message>
<location filename="../editaddressdialog.cpp" line="111"/>
<source>The entered address &quot;%1&quot; is not a valid Dash address.</source>
<translation>&quot;%1&quot;</translation>
<translation>&quot;%1&quot;</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="116"/>
@ -1295,12 +1295,12 @@ Address: %4
<message>
<location filename="../forms/helpmessagedialog.ui" line="19"/>
<source>Dash Core - Command-line options</source>
<translation> - </translation>
<translation> - </translation>
</message>
<message>
<location filename="../utilitydialog.cpp" line="69"/>
<source>Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../utilitydialog.cpp" line="69"/>
@ -1358,17 +1358,17 @@ Address: %4
<message>
<location filename="../forms/intro.ui" line="23"/>
<source>Welcome to Dash Core.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/intro.ui" line="49"/>
<source>As this is the first time the program is launched, you can choose where Dash Core will store its data.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/intro.ui" line="59"/>
<source>Dash Core will download and store a copy of the Dash block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory.</source>
<translation> %1GB </translation>
<translation> %1GB </translation>
</message>
<message>
<location filename="../forms/intro.ui" line="69"/>
@ -1383,7 +1383,7 @@ Address: %4
<message>
<location filename="../intro.cpp" line="185"/>
<source>Dash</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../intro.cpp" line="186"/>
@ -1449,12 +1449,12 @@ Address: %4
<message>
<location filename="../forms/optionsdialog.ui" line="33"/>
<source>Automatically start Dash after logging in to the system.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="36"/>
<source>&amp;Start Dash on system login</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="45"/>
@ -1494,7 +1494,7 @@ Address: %4
<message>
<location filename="../forms/optionsdialog.ui" line="180"/>
<source>Amount of Dash to keep anonymized</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="206"/>
@ -1544,7 +1544,7 @@ Address: %4
<message>
<location filename="../forms/optionsdialog.ui" line="307"/>
<source>Automatically open the Dash client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>UPnP時有效</translation>
<translation>UPnP時有效</translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="310"/>
@ -1554,7 +1554,7 @@ Address: %4
<message>
<location filename="../forms/optionsdialog.ui" line="317"/>
<source>Connect to the Dash network through a SOCKS proxy.</source>
<translation>SOCKS代理鏈接暗黑幣網絡</translation>
<translation>SOCKS代理鏈接達世幣網絡</translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="320"/>
@ -1629,7 +1629,7 @@ Address: %4
<message>
<location filename="../forms/optionsdialog.ui" line="503"/>
<source>The user interface language can be set here. This setting will take effect after restarting Dash.</source>
<translation>使</translation>
<translation>使</translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="524"/>
@ -1651,7 +1651,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/optionsdialog.ui" line="572"/>
<source>Whether to show Dash addresses in the transaction list or not.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/optionsdialog.ui" line="575"/>
@ -1748,7 +1748,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<location filename="../forms/overviewpage.ui" line="953"/>
<location filename="../forms/overviewpage.ui" line="1021"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Dash network after a connection is established, but this process has not completed yet.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="114"/>
@ -1813,7 +1813,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/overviewpage.ui" line="349"/>
<source>0 DASH</source>
<translation>0 </translation>
<translation>0 </translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="356"/>
@ -1823,7 +1823,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../forms/overviewpage.ui" line="363"/>
<source>0 DASH / 0 Rounds</source>
<translation>0 / 0 </translation>
<translation>0 / 0 </translation>
</message>
<message>
<location filename="../forms/overviewpage.ui" line="370"/>
@ -1945,7 +1945,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../overviewpage.cpp" line="381"/>
<source>Mixing in progress...</source>
<translation type="unfinished"/>
<translation>...</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="387"/>
@ -2065,7 +2065,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../paymentserver.cpp" line="294"/>
<source>Cannot start dash: click-to-pay handler</source>
<translation>click-to-pay handler</translation>
<translation>click-to-pay handler</translation>
</message>
<message>
<location filename="../paymentserver.cpp" line="352"/>
@ -2091,7 +2091,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../paymentserver.cpp" line="418"/>
<source>URI can not be parsed! This can be caused by an invalid Dash address or malformed URI parameters.</source>
<translation>! </translation>
<translation>! </translation>
</message>
<message>
<location filename="../paymentserver.cpp" line="432"/>
@ -2152,7 +2152,7 @@ https://www.transifex.com/projects/p/dash/</translation>
<location filename="../dash.cpp" line="539"/>
<location filename="../dash.cpp" line="552"/>
<source>Dash</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dash.cpp" line="526"/>
@ -2177,12 +2177,12 @@ https://www.transifex.com/projects/p/dash/</translation>
<message>
<location filename="../dash.cpp" line="612"/>
<source>Dash Core didn&apos;t yet exit safely...</source>
<translation>退...</translation>
<translation>退...</translation>
</message>
<message>
<location filename="../guiutil.cpp" line="101"/>
<source>Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</source>
<translation>(.
<translation>(.
XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
</message>
</context>
@ -2355,7 +2355,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../rpcconsole.cpp" line="333"/>
<source>Welcome to the Dash RPC console.</source>
<translation>RPC控制台</translation>
<translation>RPC控制台</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="334"/>
@ -2419,7 +2419,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<location filename="../forms/receivecoinsdialog.ui" line="51"/>
<location filename="../forms/receivecoinsdialog.ui" line="74"/>
<source>An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dash network.</source>
<translation>注意: 這個訊息不會隨著付款送到暗黑幣網路上</translation>
<translation>注意: 這個訊息不會隨著付款送到達世幣網路上</translation>
</message>
<message>
<location filename="../forms/receivecoinsdialog.ui" line="54"/>
@ -2904,7 +2904,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../sendcoinsdialog.cpp" line="635"/>
<source>Warning: Invalid Dash address</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="644"/>
@ -2986,7 +2986,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../forms/sendcoinsentry.ui" line="157"/>
<source>A message that was attached to the dash: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Dash network.</source>
<translation> URI 注意: 這個訊息不會送到暗黑幣網路上</translation>
<translation> URI 注意: 這個訊息不會送到達世幣網路上</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="583"/>
@ -3021,7 +3021,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../utilitydialog.cpp" line="129"/>
<source>Dash Core is shutting down...</source>
<translation>...</translation>
<translation>...</translation>
</message>
<message>
<location filename="../utilitydialog.cpp" line="130"/>
@ -3091,7 +3091,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="152"/>
<source>Sign the message to prove you own this Dash address</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="155"/>
@ -3127,7 +3127,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="295"/>
<source>Verify the message to ensure it was signed with the specified Dash address</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="298"/>
@ -3147,7 +3147,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../signverifymessagedialog.cpp" line="31"/>
<source>Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</source>
<translation>(.
<translation>(.
XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
</message>
<message>
@ -3222,7 +3222,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../splashscreen.cpp" line="33"/>
<source>Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../splashscreen.cpp" line="34"/>
@ -3237,7 +3237,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../splashscreen.cpp" line="36"/>
<source>The Dash Core developers</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../splashscreen.cpp" line="37"/>
@ -3620,7 +3620,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../transactiontablemodel.cpp" line="376"/>
<source>Darksent</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="418"/>
@ -3704,7 +3704,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg)</translation>
<message>
<location filename="../transactionview.cpp" line="81"/>
<source>Darksent</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../transactionview.cpp" line="82"/>
@ -3971,7 +3971,7 @@ rpcpassword=%s
<message>
<location filename="../dashstrings.cpp" line="40"/>
<source>Cannot obtain a lock on data directory %s. Dash Core is probably already running.</source>
<translation>%s. </translation>
<translation>%s. </translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="43"/>
@ -3981,7 +3981,7 @@ rpcpassword=%s
<message>
<location filename="../dashstrings.cpp" line="46"/>
<source>Darksend uses exact denominated amounts to send funds, you might simply need to anonymize some more coins.</source>
<translation>使</translation>
<translation>使</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="49"/>
@ -4096,7 +4096,7 @@ rpcpassword=%s
<message>
<location filename="../dashstrings.cpp" line="110"/>
<source>Provide liquidity to Darksend by infrequently mixing coins on a continual basis (0-100, default: 0, 1=very frequent, high fees, 100=very infrequent, low fees)</source>
<translation> (0-100預設值 : 0 1= 100=)</translation>
<translation> (0-100預設值 : 0 1= 100=)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="114"/>
@ -4136,12 +4136,12 @@ rpcpassword=%s
<message>
<location filename="../dashstrings.cpp" line="133"/>
<source>Unable to bind to %s on this computer. Dash Core is probably already running.</source>
<translation> %s </translation>
<translation> %s </translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="136"/>
<source>Unable to locate enough Darksend denominated funds for this transaction.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="138"/>
@ -4166,12 +4166,12 @@ rpcpassword=%s
<message>
<location filename="../dashstrings.cpp" line="149"/>
<source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Dash will not work properly.</source>
<translation>警告: 請檢查電腦日期和時間是否正確</translation>
<translation>警告: 請檢查電腦日期和時間是否正確</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="152"/>
<source>Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues.</source>
<translation>警告: 暗黑幣網路對於區塊鏈結的決定目前有分歧</translation>
<translation>警告: 達世幣網路對於區塊鏈結的決定目前有分歧</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="155"/>
@ -4340,22 +4340,22 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="200"/>
<source>Dash Core Daemon</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="201"/>
<source>Dash Core RPC client version</source>
<translation>RPC客戶端版本</translation>
<translation>RPC客戶端版本</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="202"/>
<source>Darksend is disabled.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="203"/>
<source>Darksend options:</source>
<translation> :</translation>
<translation> :</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="204"/>
@ -4390,7 +4390,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="210"/>
<source>Downgrading and trying again.</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="211"/>
@ -4435,7 +4435,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="219"/>
<source>Error loading wallet.dat: Wallet requires newer version of Dash</source>
<translation> wallet.dat 時發生錯誤: 錢包需要更新的暗黑幣版本</translation>
<translation> wallet.dat 時發生錯誤: 錢包需要更新的達世幣版本</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="220"/>
@ -4450,7 +4450,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="222"/>
<source>Error recovering public key.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="223"/>
@ -4550,7 +4550,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="242"/>
<source>Generate coins (default: 0)</source>
<translation> (預設值: 0)</translation>
<translation> (預設值: 0)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="243"/>
@ -4605,7 +4605,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="253"/>
<source>Initialization sanity check failed. Dash Core is shutting down.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="254"/>
@ -4685,7 +4685,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="269"/>
<source>Keep N dash anonymized (default: 0)</source>
<translation> N (預設值 : 0)</translation>
<translation> N (預設值 : 0)</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="270"/>
@ -4705,7 +4705,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="273"/>
<source>Last successful darksend action was too recent.</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="274"/>
@ -4735,7 +4735,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="279"/>
<source>Loading masternode list...</source>
<translation type="unfinished"/>
<translation>...</translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="280"/>
@ -4930,7 +4930,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="318"/>
<source>Send command to Dash Core</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="319"/>
@ -5070,7 +5070,7 @@ If the file does not exist, create it with owner-readable-only file permissions.
<message>
<location filename="../dashstrings.cpp" line="346"/>
<source>Start Dash Core Daemon</source>
<translation></translation>
<translation></translation>
</message>
<message>
<location filename="../dashstrings.cpp" line="347"/>

View File

@ -300,6 +300,7 @@ void OverviewPage::updateDarksendProgress()
{
denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / denominatedBalance;
denomPart = denomPart > 1 ? 1 : denomPart;
if(denomPart == 1 && nMaxToAnonymize > denominatedBalance) nMaxToAnonymize = denominatedBalance;
}
// % of fully anonymized balance
@ -313,7 +314,7 @@ void OverviewPage::updateDarksendProgress()
// apply some weights to them (sum should be <=100) and calculate the whole progress
int progress = 80 * denomPart + 20 * anonPart;
if(progress > 100) progress = 100;
if(progress >= 100) progress = 100;
ui->darksendProgress->setValue(progress);

View File

@ -576,6 +576,9 @@ Value masternode(const Array& params, bool fHelp)
std::vector<CMasternodeConfig::CMasternodeEntry> mnEntries;
mnEntries = masternodeConfig.getEntries();
if (params.size() != 2)
throw runtime_error("You can only vote 'yea' or 'nay'");
std::string vote = params[1].get_str().c_str();
if(vote != "yea" && vote != "nay") return "You can only vote 'yea' or 'nay'";
int nVote = 0;
@ -583,6 +586,9 @@ Value masternode(const Array& params, bool fHelp)
if(vote == "nay") nVote = -1;
int success = 0;
int failed = 0;
Object resultObj;
BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) {
@ -590,33 +596,48 @@ Value masternode(const Array& params, bool fHelp)
std::vector<unsigned char> vchMasterNodeSignature;
std::string strMasterNodeSignMessage;
CTxIn vin;
CPubKey pubKeyCollateralAddress;
CKey keyCollateralAddress;
CPubKey pubKeyMasternode;
CKey keyMasternode;
if(!activeMasternode.GetMasterNodeVin(vin, pubKeyCollateralAddress, keyCollateralAddress, mne.getTxHash(), mne.getOutputIndex())) {
return("could not allocate vin");
if(!darkSendSigner.SetKey(mne.getPrivKey(), errorMessage, keyMasternode, pubKeyMasternode)){
printf(" Error upon calling SetKey for %s\n", mne.getAlias().c_str());
failed++;
continue;
}
CMasternode* pmn = mnodeman.Find(pubKeyMasternode);
if(pmn == NULL)
{
printf("Can't find masternode by pubkey for %s\n", mne.getAlias().c_str());
failed++;
continue;
}
std::string strMessage = vin.ToString() + boost::lexical_cast<std::string>(nVote);
std::string strMessage = pmn->vin.ToString() + boost::lexical_cast<std::string>(nVote);
if(!darkSendSigner.SetKey(mne.getPrivKey(), errorMessage, keyMasternode, pubKeyMasternode))
return(" Error upon calling SetKey");
if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchMasterNodeSignature, keyMasternode)){
printf(" Error upon calling SignMessage for %s\n", mne.getAlias().c_str());
failed++;
continue;
}
if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchMasterNodeSignature, keyMasternode))
return(" Error upon calling SignMessage");
if(!darkSendSigner.VerifyMessage(pubKeyMasternode, vchMasterNodeSignature, strMessage, errorMessage)){
printf(" Error upon calling VerifyMessage for %s\n", mne.getAlias().c_str());
failed++;
continue;
}
if(!darkSendSigner.VerifyMessage(pubKeyMasternode, vchMasterNodeSignature, strMessage, errorMessage))
return(" Error upon calling VerifyMessage");
success++;
//send to all peers
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("mvote", vin, vchMasterNodeSignature, nVote);
pnode->PushMessage("mvote", pmn->vin, vchMasterNodeSignature, nVote);
}
return("Voted successfully " + boost::lexical_cast<std::string>(success) + " time(s) and failed " + boost::lexical_cast<std::string>(failed) + " time(s).");
}
if(strCommand == "vote")
@ -624,6 +645,9 @@ Value masternode(const Array& params, bool fHelp)
std::vector<CMasternodeConfig::CMasternodeEntry> mnEntries;
mnEntries = masternodeConfig.getEntries();
if (params.size() != 2)
throw runtime_error("You can only vote 'yea' or 'nay'");
std::string vote = params[1].get_str().c_str();
if(vote != "yea" && vote != "nay") return "You can only vote 'yea' or 'nay'";
int nVote = 0;
@ -785,7 +809,7 @@ Value masternodelist(const Array& params, bool fHelp)
if(mn.nVote == 1) strStatus = "YEA";
}
if(strFilter !="" && (strAddr.find(strFilter) == string::npos || strStatus.find(strFilter) == string::npos)) continue;
if(strFilter !="" && (strAddr.find(strFilter) == string::npos && strStatus.find(strFilter) == string::npos)) continue;
obj.push_back(Pair(strAddr, strStatus.c_str()));
}
}

View File

@ -39,7 +39,7 @@ void ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
if(chainActive.Tip() == NULL) return;
uint256 hash = spork.GetHash();
if(mapSporks.count(hash) && mapSporksActive.count(spork.nSporkID)) {
if(mapSporksActive.count(spork.nSporkID)) {
if(mapSporksActive[spork.nSporkID].nTimeSigned >= spork.nTimeSigned){
if(fDebug) LogPrintf("spork - seen %s block %d \n", hash.ToString().c_str(), chainActive.Tip()->nHeight);
return;
@ -230,4 +230,4 @@ std::string CSporkManager::GetSporkNameByID(int id)
if(id == SPORK_7_MASTERNODE_SCANNING) return "SPORK_7_MASTERNODE_SCANNING";
return "Unknown";
}
}

View File

@ -27,7 +27,7 @@ extern const std::string CLIENT_DATE;
// network protocol versioning
//
static const int PROTOCOL_VERSION = 70075;
static const int PROTOCOL_VERSION = 70076;
// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;

View File

@ -1538,16 +1538,15 @@ struct CompareByPriority
}
};
bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, vector<COutput>& setCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax)
bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& vCoinsRet, std::vector<COutput>& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax)
{
setCoinsRet.clear();
vCoinsRet.clear();
nValueRet = 0;
setCoinsRet2.clear();
vCoinsRet2.clear();
vector<COutput> vCoins;
AvailableCoins(vCoins);
AvailableCoins(vCoins, true, NULL, ONLY_DENOMINATED);
//order the array so fees are first, then denominated money, then the rest.
std::random_shuffle(vCoins.rbegin(), vCoins.rend());
//keep track of each denomination that we have
@ -1564,9 +1563,8 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t
BOOST_FOREACH(const COutput& out, vCoins)
{
//there's no reason to allow inputs less than 1 COIN into DS (other than denominations smaller than that amount)
if(out.tx->vout[out.i].nValue < 1*COIN && out.tx->vout[out.i].nValue != (.1*COIN)+100) continue;
if(fMasterNode && out.tx->vout[out.i].nValue == 1000*COIN) continue; //masternode input
// masternode-like input should not be selected by AvailableCoins now anyway
//if(out.tx->vout[out.i].nValue == 1000*COIN) continue;
if(nValueRet + out.tx->vout[out.i].nValue <= nValueMax){
bool fAccepted = false;
@ -1590,7 +1588,7 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t
nValueMax -= (rand() % (nValueMax/5));
//on average use 50% of the inputs or less
int r = (rand() % (int)vCoins.size());
if((int)setCoinsRet.size() > r) return true;
if((int)vCoinsRet.size() > r) return true;
}
//Denomination criterion has been met, we can take any matching denominations
if((nDenom & (1 << 0)) && out.tx->vout[out.i].nValue == ((100*COIN) +100000)) {fAccepted = true;}
@ -1608,8 +1606,8 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t
vin.prevPubKey = out.tx->vout[out.i].scriptPubKey; // the inputs PubKey
nValueRet += out.tx->vout[out.i].nValue;
setCoinsRet.push_back(vin);
setCoinsRet2.push_back(out);
vCoinsRet.push_back(vin);
vCoinsRet2.push_back(out);
}
}

View File

@ -134,7 +134,7 @@ private:
public:
bool SelectCoins(int64_t nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl = NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX = true) const;
bool SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const;
bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, vector<COutput>& vCoins, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax);
bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& vCoinsRet, std::vector<COutput>& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax);
bool SelectCoinsDarkDenominated(int64_t nTargetValue, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet) const;
bool HasCollateralInputs() const;
bool IsCollateralAmount(int64_t nInputAmount) const;