diff --git a/configure.ac b/configure.ac index d1521419d1..abb9d3095c 100644 --- a/configure.ac +++ b/configure.ac @@ -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, 4) +define(_CLIENT_VERSION_BUILD, 6) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashcurrency.com],[darkcoin]) diff --git a/doc/guide-startmany.md b/doc/guide-startmany.md index 7a8cd952df..152abec4cc 100644 --- a/doc/guide-startmany.md +++ b/doc/guide-startmany.md @@ -97,17 +97,19 @@ Make note of the hash (which is your collaterla_output) and index. ### Enter your MasterNode details into your masternode.conf file [From the darkcoin github repo](https://github.com/darkcoin/darkcoin/blob/master/doc/masternode_conf.md) -The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index. +The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index, donation address and donation percentage (the latter two are optional and should be in format "address:percantage"). ``` -alias ipaddress:port masternode_private_key collateral_output collateral_output_index +alias ipaddress:port masternode_private_key collateral_output collateral_output_index donationin_address:donation_percentage ``` + + Example: ``` mn01 127.0.0.1:9999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0 -mn02 127.0.0.2:9999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 +mn02 127.0.0.2:9999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh:25 ``` ## What about the darkcoin.conf file? diff --git a/doc/masternode_conf.md b/doc/masternode_conf.md index 1ec7b07328..77441ddb63 100644 --- a/doc/masternode_conf.md +++ b/doc/masternode_conf.md @@ -6,18 +6,20 @@ The multi masternode config allows to control multiple masternodes from a single * Mac OS: ~/Library/Application Support/Dash/ * Unix/Linux: ~/.darkcoin/ -The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id and collateral output index. +The new masternode.conf format consists of a space seperated text file. Each line consisting of an alias, IP address followed by port, masternode private key, collateral output transaction id, collateral output index, donation address and donation percentage (the latter two are optional and should be in format "address:percantage"). Example: ``` mn1 127.0.0.2:19999 93HaYBVUCYjEMeeH1Y4sBGLALQZE1Yc1K64xiqgX37tGBDQL8Xg 2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c 0 -mn2 127.0.0.3:19999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 -mn3 127.0.0.4:19999 92Da1aYg6sbenP6uwskJgEY2XWB5LwJ7bXRqc3UPeShtHWJDjDv db478e78e3aefaa8c12d12ddd0aeace48c3b451a8b41c570d0ee375e2a02dfd9 1 +mn2 127.0.0.3:19999 93WaAb3htPJEV8E9aQcN23Jt97bPex7YvWfgMDTUdWJvzmrMqey aa9f1034d973377a5e733272c3d0eced1de22555ad45d6b24abadff8087948d4 0 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh:33 +mn3 127.0.0.4:19999 92Da1aYg6sbenP6uwskJgEY2XWB5LwJ7bXRqc3UPeShtHWJDjDv db478e78e3aefaa8c12d12ddd0aeace48c3b451a8b41c570d0ee375e2a02dfd9 1 7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh ``` -In the example above, the collateral for mn1 consists of transaction: -http://test.explorer.darkcoin.fr/tx/2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c -output index 0 has amount 1000 +In the example above: +* the collateral for mn1 consists of transaction http://test.explorer.darkcoin.fr/tx/2bcd3c84c84f87eaa86e4e56834c92927a07f9e18718810b92e0d0324456a67c, output index 0 has amount 1000 +* masternode 2 will donate 33% of its income +* masternode 3 will donate 100% of its income + The following new RPC commands are supported: * list-conf: shows the parsed masternode.conf diff --git a/src/clientversion.h b/src/clientversion.h index d8efe956d1..894b54dd6e 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 4 +#define CLIENT_VERSION_BUILD 6 diff --git a/src/core.h b/src/core.h index 6d6ebfd2f7..f80f210334 100644 --- a/src/core.h +++ b/src/core.h @@ -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 = 70070; // minimum peer version accepted by DarkSendPool +static const int MIN_POOL_PEER_PROTO_VERSION = 70072; // minimum peer version accepted by DarkSendPool class CTransaction; diff --git a/src/darksend.cpp b/src/darksend.cpp index 554d8462c9..5c5e4d2dcd 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -285,7 +285,6 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } // relay to all peers that an entry was added to the pool successfully. - RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_ACCEPTED); Check(); } else if (strCommand == "dsi") { //Darksend vIn @@ -642,12 +641,7 @@ void CDarksendPool::SetNull(bool clearEverything){ if(clearEverything){ myEntries.clear(); - - if(fMasterNode){ - sessionID = 1 + (rand() % 999999); - } else { - sessionID = 0; - } + sessionID = 0; } // -- seed random number generator (used for ordering output lists) @@ -765,7 +759,7 @@ void CDarksendPool::CheckFinalTransaction() // See if the transaction is valid if (!txNew.AcceptToMemoryPool(false)) { - if(nCountAttempts > 10) { + if(nCountAttempts > 60) { LogPrintf("CDarksendPool::Check() - CommitTransaction : Error: Transaction not valid\n"); SetNull(); pwalletMain->Lock(); @@ -773,9 +767,8 @@ void CDarksendPool::CheckFinalTransaction() // not much we can do in this case] UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - if(nCountAttempts > 5) RelayCompletedTransaction(sessionID, true, "Transaction not valid, please try again"); - - if(!fSubmitAnonymousFailed && nCountAttempts > 5) + + if(!fSubmitAnonymousFailed && nCountAttempts > 30) fSubmitAnonymousFailed = true; return; } @@ -1418,7 +1411,7 @@ bool CDarksendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep lastMessage = error; } - if(newAccepted == 1) { + if(newAccepted == 1 && newSessionID != 0) { sessionID = newSessionID; LogPrintf("CDarksendPool::StatusUpdate - set sessionID to %d\n", sessionID); sessionFoundMasternode = true; @@ -1476,8 +1469,8 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod if(mine >= 0){ //might have to do this one input at a time? //already signed - if(finalTransaction.vin[mine].scriptSig != CScript()) continue; - if(sigs.size() > 7) break; //send 7 each signing + CScript scriptOld = finalTransaction.vin[mine].scriptSig; + if(!fSubmitAnonymousFailed && sigs.size() > 7) break; //send 7 each signing int foundOutputs = 0; int64_t nValue1 = 0; @@ -1510,6 +1503,8 @@ 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()); } @@ -2127,6 +2122,7 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla if(sessionUsers < 0) sessionUsers = 0; if(sessionUsers == 0) { + sessionID = 1 + (rand() % 999999); sessionDenom = nDenom; sessionUsers++; lastTimeChanged = GetTimeMillis(); @@ -2554,6 +2550,7 @@ bool CDSAnonTx::AddOutput(const CTxOut out){ vout.push_back(out); std::random_shuffle ( vout.begin(), vout.end(), randomizeList); + ClearSigs(); return true; } @@ -2570,6 +2567,16 @@ bool CDSAnonTx::AddInput(const CTxIn in){ vin.push_back(in); std::random_shuffle ( vin.begin(), vin.end(), randomizeList); + ClearSigs(); + + return true; +} + +bool CDSAnonTx::ClearSigs(){ + LOCK(cs_darksend); + + BOOST_FOREACH(CTxDSIn& in, vin) + in.scriptSig = CScript(); return true; } diff --git a/src/darksend.h b/src/darksend.h index 73b9ce57d2..1f24ee833a 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -38,9 +38,9 @@ class CActiveMasternode; #define MASTERNODE_REJECTED 0 #define MASTERNODE_RESET -1 -#define DARKSEND_QUEUE_TIMEOUT 120 // in seconds +#define DARKSEND_QUEUE_TIMEOUT 180 // in seconds #define DARKSEND_SIGNING_TIMEOUT 30 // in seconds -#define DARKSEND_DOWNGRADE_TIMEOUT 30 // in seconds +#define DARKSEND_DOWNGRADE_TIMEOUT 60 // in seconds // used for anonymous relaying of inputs/outputs/sigs #define DARKSEND_RELAY_IN 1 @@ -63,7 +63,7 @@ class CTxDSIn : public CTxIn { public: bool fHasSig; // flag to indicate if signed - int nSentTimes; //times we've sent this anonymously + int nSentTimes; //times we've sent this anonymously CTxDSIn(const CTxIn& in) { @@ -80,7 +80,7 @@ public: class CTxDSOut : public CTxOut { public: - int nSentTimes; //times we've sent this anonymously + int nSentTimes; //times we've sent this anonymously CTxDSOut(const CTxOut& out) { @@ -206,7 +206,7 @@ public: return false; } - /// Set the 'strSharedKey' + /// Set the 'strSharedKey' void SetSharedKey(std::string strSharedKey); /** Sign this Darksend transaction @@ -269,8 +269,10 @@ public: bool IsTransactionValid(); /// Add an output bool AddOutput(const CTxOut out); - /// Add an input + /// 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 @@ -521,11 +523,11 @@ public: void ClearLastMessage(); /// Used for liquidity providers bool SendRandomPaymentToSelf(); - + /// Split up large inputs or make fee sized inputs bool MakeCollateralAmounts(); bool CreateDenominated(int64_t nTotalValue); - + /// Get the denominations for a list of outputs (returns a bitshifted integer) int GetDenominations(const std::vector& vout); int GetDenominations(const std::vector& vout); diff --git a/src/masternode-pos.h b/src/masternode-pos.h index 0142a906c4..78e4a4c46f 100644 --- a/src/masternode-pos.h +++ b/src/masternode-pos.h @@ -25,12 +25,12 @@ class CMasternodeScanningError; extern map mapMasternodeScanningErrors; extern CMasternodeScanning mnscan; -static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70066; +static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70072; /* 1% of the network is scanned every 2.5 minutes, making a full - round of scanning take about 4.16 hours. We're targeting about - a day of proof-of-service errors for complete removal from the + round of scanning take about 4.16 hours. We're targeting about + a day of proof-of-service errors for complete removal from the masternode system. */ static const int MASTERNODE_SCANNING_ERROR_THESHOLD = 6; diff --git a/src/masternode.cpp b/src/masternode.cpp index 501c33de56..589a7150a8 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -143,6 +143,7 @@ CMasternode::CMasternode() nLastDsq = 0; donationAddress = CScript(); donationPercentage = 0; + nScanningErrorCount = 0; } CMasternode::CMasternode(const CMasternode& other) @@ -165,6 +166,7 @@ CMasternode::CMasternode(const CMasternode& other) nLastDsq = other.nLastDsq; donationAddress = other.donationAddress; donationPercentage = other.donationPercentage; + nScanningErrorCount = other.nScanningErrorCount; } CMasternode::CMasternode(CService newAddr, CTxIn newVin, CPubKey newPubkey, std::vector newSig, int64_t newSigTime, CPubKey newPubkey2, int protocolVersionIn, CScript newDonationAddress, int newDonationPercentage) @@ -185,6 +187,7 @@ CMasternode::CMasternode(CService newAddr, CTxIn newVin, CPubKey newPubkey, std: allowFreeTx = true; protocolVersion = protocolVersionIn; nLastDsq = 0; + nScanningErrorCount = 0; donationAddress = newDonationAddress; donationPercentage = newDonationPercentage; } @@ -404,8 +407,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) // pay to the oldest MN that still had no payment but its input is old enough and it was active long enough CMasternode *pmn = mnodeman.FindOldestNotInVec(vecLastPayments); - - if(pmn != NULL) + if(pmn != NULL && + (RegTest() || (!RegTest() && pmn->GetMasternodeInputAge() > nMinimumAge && pmn->lastTimeSeen - pmn->sigTime > nMinimumAge * 2.5 * 60))) { newWinner.score = 0; newWinner.nBlockHeight = nBlockHeight; diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 4aa8837cee..af6bea6a39 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -800,9 +800,9 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData { if(fDebug) LogPrintf("dseg - Sending Masternode entry - %s \n", mn.addr.ToString().c_str()); if(vin == CTxIn()){ - pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion); + pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion, mn.donationAddress, mn.donationPercentage); } else if (vin == mn.vin) { - pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion); + pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion, mn.donationAddress, mn.donationPercentage); LogPrintf("dseg - Sent 1 Masternode entries to %s\n", pfrom->addr.ToString().c_str()); return; } diff --git a/src/qt/guiutil.cpp b/src/qt/guiutil.cpp index b7d4450db0..34dd7c9996 100755 --- a/src/qt/guiutil.cpp +++ b/src/qt/guiutil.cpp @@ -776,7 +776,7 @@ QString loadStyleSheet() } else { cssName = QString(":/css/drkblue"); - settings.setValue("theme", ":/css/drkblue"); + settings.setValue("theme", "drkblue"); } QFile qFile(cssName); diff --git a/src/qt/res/css/drkblue.css b/src/qt/res/css/drkblue.css index df3434054c..86661db55b 100755 --- a/src/qt/res/css/drkblue.css +++ b/src/qt/res/css/drkblue.css @@ -605,7 +605,6 @@ QDialog#AboutDialog QLabel#label_2 { /* Margin for About Dash text */ margin-right:10px; } - /* OVERVIEW SCREEN */ QWidget .QFrame#frame { /* Wallet Balance */ @@ -686,10 +685,14 @@ margin-left:16px; QWidget .QFrame#frameDarksend { /* Darksend Widget */ background-color:transparent; +qproperty-minimumSize: 451px 318px; +} + +QWidget .QFrame#frameDarksend QWidget { +qproperty-geometry: rect(10 0 431 22); } QWidget .QFrame#frameDarksend .QLabel#label_2 { /* Darksend Header */ -qproperty-geometry: rect(10 9 431 135); qproperty-alignment: 'AlignVCenter | AlignRight'; min-width:230px; color:#3398cc; @@ -702,7 +705,7 @@ min-height:22px; QWidget .QFrame#frameDarksend #formLayoutWidget { -qproperty-geometry: rect(10 55 451 175); +qproperty-geometry: rect(10 38 451 175); } QWidget .QFrame#frameDarksend #formLayoutWidget > .QLabel { @@ -784,7 +787,7 @@ QWidget .QFrame#frameDarksend #formLayoutWidget .QLabel#labelSubmittedDenom { /* QWidget .QFrame#frameDarksend .QLabel#darksendStatus { /* Darksend Status Notifications */ qproperty-alignment: 'AlignVCenter | AlignCenter'; -qproperty-geometry: rect(70 233 395 45); +qproperty-geometry: rect(70 213 395 34); font-size:11px; color:#818181; } @@ -792,6 +795,9 @@ color:#818181; /* DARKSEND BUTTONS */ + + + QWidget .QFrame#frameDarksend .QPushButton { /* Darksend Buttons - General Attributes */ border:0px solid #ffffff; } @@ -802,11 +808,11 @@ outline:none; } QWidget .QFrame#frameDarksend .QPushButton#runAutoDenom { /* No idea why this button is in the .UI file... */ -qproperty-geometry: rect(391 -25 1 1); +qproperty-geometry: rect(0 0 0 0); } QWidget .QFrame#frameDarksend .QPushButton#toggleDarksend { /* Start Darksend Mixing */ -qproperty-geometry: rect(120 282 295 35); +qproperty-geometry: rect(120 255 295 35); border:1px solid #ffffff; font-size:16px; font-weight:bold; @@ -818,7 +824,7 @@ padding-bottom:6px; } QWidget .QFrame#frameDarksend .QPushButton#darksendAuto { /* Try Mix Button */ -qproperty-geometry: rect(150 328 118 20); +qproperty-geometry: rect(150 301 118 20); background-color:#F8F6F6; border:0px; border-right:1px solid #c1c1c1; @@ -834,7 +840,7 @@ background-color:#f2f0f0; QWidget .QFrame#frameDarksend .QPushButton#darksendReset { /* Reset Button */ -qproperty-geometry: rect(268 328 117 20); +qproperty-geometry: rect(268 301 117 20); background-color:#F8F6F6; border:0px; border-radius: 0px; diff --git a/src/qt/res/icons/tx_inout.png b/src/qt/res/icons/tx_inout.png old mode 100644 new mode 100755 index 49d7fbd647..d68761b958 Binary files a/src/qt/res/icons/tx_inout.png and b/src/qt/res/icons/tx_inout.png differ diff --git a/src/qt/res/icons/tx_input.png b/src/qt/res/icons/tx_input.png old mode 100644 new mode 100755 index 24fa1ed92c..0d8fc423a7 Binary files a/src/qt/res/icons/tx_input.png and b/src/qt/res/icons/tx_input.png differ diff --git a/src/qt/res/icons/tx_mined.png b/src/qt/res/icons/tx_mined.png old mode 100644 new mode 100755 index 374ded0c7e..a4fa69e166 Binary files a/src/qt/res/icons/tx_mined.png and b/src/qt/res/icons/tx_mined.png differ diff --git a/src/qt/res/icons/tx_output.png b/src/qt/res/icons/tx_output.png old mode 100644 new mode 100755 index e872a0a138..425c571c89 Binary files a/src/qt/res/icons/tx_output.png and b/src/qt/res/icons/tx_output.png differ diff --git a/src/version.h b/src/version.h index 1f95989381..62c05ba149 100644 --- a/src/version.h +++ b/src/version.h @@ -27,7 +27,7 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70070; +static const int PROTOCOL_VERSION = 70072; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209;