32 LogPrint(
"privatesend",
"DSQUEUE -- incompatible version! nVersion: %d\n", pfrom->
nVersion);
47 LogPrint(
"privatesend",
"DSQUEUE -- %s new\n", dsq.ToString());
49 if(dsq.IsExpired())
return;
69 LogPrint(
"privatesend",
"DSQUEUE -- PrivateSend queue (%s) is ready on masternode %s\n", dsq.ToString(), infoMn.
addr.
ToString());
74 if(q.
vin == dsq.vin) {
76 LogPrint(
"privatesend",
"DSQUEUE -- Masternode %s is sending WAY too many dsq messages\n", infoMn.
addr.
ToString());
85 LogPrint(
"privatesend",
"DSQUEUE -- Masternode %s is sending too many dsq messages\n", infoMn.
addr.
ToString());
91 LogPrint(
"privatesend",
"DSQUEUE -- new PrivateSend queue (%s) from masternode %s\n", dsq.ToString(), infoMn.
addr.
ToString());
102 LogPrintf(
"DSSTATUSUPDATE -- incompatible version! nVersion: %d\n", pfrom->
nVersion);
114 int nMsgEntriesCount;
115 int nMsgStatusUpdate;
117 vRecv >> nMsgSessionID >> nMsgState >> nMsgEntriesCount >> nMsgStatusUpdate >> nMsgMessageID;
119 LogPrint(
"privatesend",
"DSSTATUSUPDATE -- nMsgSessionID %d nMsgState: %d nEntriesCount: %d nMsgStatusUpdate: %d nMsgMessageID %d\n",
120 nMsgSessionID, nMsgState,
nEntriesCount, nMsgStatusUpdate, nMsgMessageID);
123 LogPrint(
"privatesend",
"DSSTATUSUPDATE -- nMsgState is out of bounds: %d\n", nMsgState);
127 if(nMsgStatusUpdate < STATUS_REJECTED || nMsgStatusUpdate >
STATUS_ACCEPTED) {
128 LogPrint(
"privatesend",
"DSSTATUSUPDATE -- nMsgStatusUpdate is out of bounds: %d\n", nMsgStatusUpdate);
132 if(nMsgMessageID < MSG_POOL_MIN || nMsgMessageID >
MSG_POOL_MAX) {
133 LogPrint(
"privatesend",
"DSSTATUSUPDATE -- nMsgMessageID is out of bounds: %d\n", nMsgMessageID);
140 LogPrint(
"privatesend",
"DSSTATUSUPDATE -- CheckPoolStateUpdate failed\n");
158 vRecv >> nMsgSessionID >> txNew;
161 LogPrint(
"privatesend",
"DSFINALTX -- message doesn't match current PrivateSend session: nSessionID: %d nMsgSessionID: %d\n",
nSessionID, nMsgSessionID);
165 LogPrint(
"privatesend",
"DSFINALTX -- txNew %s", txNew.ToString());
173 LogPrintf(
"DSCOMPLETE -- incompatible version! nVersion: %d\n", pfrom->
nVersion);
185 vRecv >> nMsgSessionID >> nMsgMessageID;
187 if(nMsgMessageID < MSG_POOL_MIN || nMsgMessageID >
MSG_POOL_MAX) {
188 LogPrint(
"privatesend",
"DSCOMPLETE -- nMsgMessageID is out of bounds: %d\n", nMsgMessageID);
193 LogPrint(
"privatesend",
"DSCOMPLETE -- message doesn't match current PrivateSend session: nSessionID: %d nMsgSessionID: %d\n",
nSessionID, nMsgSessionID);
241 static int nStatusMessageProgress = 0;
242 nStatusMessageProgress += 10;
243 std::string strSuffix =
"";
250 return _(
"PrivateSend is idle.");
252 if( nStatusMessageProgress % 70 <= 30) strSuffix =
".";
253 else if(nStatusMessageProgress % 70 <= 50) strSuffix =
"..";
254 else if(nStatusMessageProgress % 70 <= 70) strSuffix =
"...";
255 return strprintf(
_(
"Submitted to masternode, waiting in queue %s"), strSuffix);;
258 nStatusMessageProgress = 0;
261 if(nStatusMessageProgress % 10 > 8) {
263 nStatusMessageProgress = 0;
265 return _(
"PrivateSend request complete:") +
" " +
_(
"Your transaction was accepted into the pool!");
268 else if(nStatusMessageProgress % 70 <= 50) strSuffix =
".";
269 else if(nStatusMessageProgress % 70 <= 60) strSuffix =
"..";
270 else if(nStatusMessageProgress % 70 <= 70) strSuffix =
"...";
274 if( nStatusMessageProgress % 70 <= 40)
return _(
"Found enough users, signing ...");
275 else if(nStatusMessageProgress % 70 <= 50) strSuffix =
".";
276 else if(nStatusMessageProgress % 70 <= 60) strSuffix =
"..";
277 else if(nStatusMessageProgress % 70 <= 70) strSuffix =
"...";
278 return strprintf(
_(
"Found enough users, signing ( waiting %s )"), strSuffix);
280 return _(
"PrivateSend request incomplete:") +
" " +
strLastMessage +
" " +
_(
"Will retry...");
295 LogPrint(
"privatesend",
"CPrivateSendClient::CheckPool -- timeout, RESETTING\n");
318 if((*it).IsExpired()) {
319 LogPrint(
"privatesend",
"CPrivateSendClient::CheckTimeout -- Removing expired queue (%s)\n", (*it).ToString());
331 LogPrint(
"privatesend",
"CPrivateSendClient::CheckTimeout -- Pool error -- Running CheckPool\n");
335 LogPrint(
"privatesend",
"CPrivateSendClient::CheckTimeout -- Pool success -- Running CheckPool\n");
348 LogPrint(
"privatesend",
"CPrivateSendClient::CheckTimeout -- %s timed out (%ds) -- restting\n",
365 LogPrintf(
"CPrivateSendClient::SendDenominate -- PrivateSend from a Masternode is not supported currently.\n");
370 LogPrintf(
"CPrivateSendClient:SendDenominate -- PrivateSend collateral not set\n");
378 BOOST_FOREACH(
CTxIn txin, vecTxIn)
383 LogPrintf(
"CPrivateSendClient::SendDenominate -- No Masternode has been selected yet.\n");
395 LogPrintf(
"CPrivateSendClient::SendDenominate -- Not enough disk space, disabling PrivateSend.\n");
402 LogPrintf(
"CPrivateSendClient::SendDenominate -- Added transaction to pool.\n");
409 BOOST_FOREACH(
const CTxIn& txin, vecTxIn) {
410 LogPrint(
"privatesend",
"CPrivateSendClient::SendDenominate -- txin=%s\n", txin.
ToString());
411 tx.
vin.push_back(txin);
414 BOOST_FOREACH(
const CTxOut& txout, vecTxOut) {
415 LogPrint(
"privatesend",
"CPrivateSendClient::SendDenominate -- txout=%s\n", txout.
ToString());
416 tx.
vout.push_back(txout);
419 LogPrintf(
"CPrivateSendClient::SendDenominate -- Submitting partial tx %s", tx.
ToString());
424 LogPrintf(
"CPrivateSendClient::SendDenominate -- AcceptToMemoryPool() failed! tx=%s", tx.
ToString());
453 LogPrintf(
"CPrivateSendClient::CheckPoolStateUpdate -- entry is rejected by Masternode\n");
467 LogPrintf(
"CPrivateSendClient::CheckPoolStateUpdate -- set nSessionID to %d\n",
nSessionID);
474 LogPrintf(
"CPrivateSendClient::CheckPoolStateUpdate -- new entry accepted!\n");
507 std::vector<CTxIn> sigs;
513 int nMyInputIndex = -1;
525 if(nMyInputIndex >= 0) {
526 int nFoundOutputsCount = 0;
533 nFoundOutputsCount++;
542 int nTargetOuputsCount = entry.
vecTxDSOut.size();
543 if(nFoundOutputsCount < nTargetOuputsCount || nValue1 != nValue2) {
546 LogPrintf(
"CPrivateSendClient::SignFinalTransaction -- My entries are not correct! Refusing to sign: nFoundOutputsCount: %d, nTargetOuputsCount: %d\n", nFoundOutputsCount, nTargetOuputsCount);
556 LogPrint(
"privatesend",
"CPrivateSendClient::SignFinalTransaction -- Signing my input %i\n", nMyInputIndex);
558 LogPrint(
"privatesend",
"CPrivateSendClient::SignFinalTransaction -- Unable to sign my own transaction!\n");
569 LogPrintf(
"CPrivateSendClient::SignFinalTransaction -- can't sign anything!\n");
588 static int64_t nTimeNewBlockReceived = 0;
591 if(
GetTime() - nTimeNewBlockReceived < 10)
return;
592 nTimeNewBlockReceived =
GetTime();
593 LogPrint(
"privatesend",
"CPrivateSendClient::NewBlock\n");
604 LogPrintf(
"CompletedTransaction -- success\n");
608 LogPrintf(
"CompletedTransaction -- error\n");
631 LogPrint(
"privatesend",
"CPrivateSendClient::CheckAutomaticBackup -- Automatic backups disabled, no mixing available.\n");
640 LogPrint(
"privatesend",
"CPrivateSendClient::CheckAutomaticBackup -- ERROR! Failed to create automatic backup.\n");
641 strAutoDenomResult =
_(
"ERROR! Failed to create automatic backup") +
", " +
_(
"see debug.log for details.");
647 LogPrint(
"privatesend",
"CPrivateSendClient::CheckAutomaticBackup -- WARNING! Failed to create replenish keypool, please unlock your wallet to do so.\n");
648 strAutoDenomResult =
_(
"WARNING! Failed to replenish keypool, please unlock your wallet to do so.") +
", " +
_(
"see debug.log for details.");
665 LogPrint(
"privatesend",
"CPrivateSendClient::CheckAutomaticBackup -- Trying to create new backup.\n");
666 std::string warningString;
667 std::string errorString;
670 if(!warningString.empty()) {
672 LogPrintf(
"CPrivateSendClient::CheckAutomaticBackup -- WARNING! Something went wrong on automatic backup: %s\n", warningString);
674 if(!errorString.empty()) {
676 LogPrintf(
"CPrivateSendClient::CheckAutomaticBackup -- ERROR! Failed to create automatic backup: %s\n", errorString);
727 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- Last successful PrivateSend action was too recent\n");
733 LogPrint(
"privatesend",
"CPrivateSendClient::DoAutomaticDenominating -- No Masternodes detected\n");
750 if(nBalanceNeedsAnonymized < nValueMin) {
751 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- Not enough funds to anonymize\n");
761 CAmount nBalanceDenominated = nBalanceDenominatedConf + nBalanceDenominatedUnconf;
763 LogPrint(
"privatesend",
"CPrivateSendClient::DoAutomaticDenominating -- nValueMin: %f, nBalanceNeedsAnonymized: %f, nBalanceAnonimizableNonDenom: %f, nBalanceDenominatedConf: %f, nBalanceDenominatedUnconf: %f, nBalanceDenominated: %f\n",
764 (
float)nValueMin/
COIN,
765 (
float)nBalanceNeedsAnonymized/
COIN,
766 (
float)nBalanceAnonimizableNonDenom/
COIN,
767 (
float)nBalanceDenominatedConf/
COIN,
768 (
float)nBalanceDenominatedUnconf/
COIN,
769 (
float)nBalanceDenominated/
COIN);
771 if(fDryRun)
return true;
796 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- Found unconfirmed denominated outputs, will wait till they confirm to continue.\n");
797 strAutoDenomResult =
_(
"Found unconfirmed denominated outputs, will wait till they confirm to continue.");
802 std::string strReason;
805 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- create collateral error:%s\n", strReason);
810 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- invalid collateral, recreating...\n");
812 LogPrintf(
"CPrivateSendClient::DoAutomaticDenominating -- create collateral error: %s\n", strReason);
821 int nThreshold_high = nMnCountEnabled * 0.9;
822 int nThreshold_low = nThreshold_high * 0.7;
823 LogPrint(
"privatesend",
"Checking vecMasternodesUsed: size: %d, threshold: %d\n", (
int)
vecMasternodesUsed.size(), nThreshold_high);
827 LogPrint(
"privatesend",
" vecMasternodesUsed: new size: %d, threshold: %d\n", (
int)
vecMasternodesUsed.size(), nThreshold_high);
838 if(
StartNewQueue(nValueMin, nBalanceNeedsAnonymized, connman))
865 std::vector<int> vecBits;
875 LogPrint(
"privatesend",
"CPrivateSendClient::JoinExistingQueue -- found valid queue: %s\n", dsq.
ToString());
878 std::vector<CTxIn> vecTxInTmp;
879 std::vector<COutput> vCoinsTmp;
889 CNode* pnodeFound = NULL;
890 bool fDisconnect =
false;
893 if(pnodeFound->fDisconnect) {
896 pnodeFound->AddRef();
903 LogPrintf(
"CPrivateSendClient::JoinExistingQueue -- attempt to connect to masternode from queue, addr=%s\n", infoMn.addr.ToString());
911 LogPrintf(
"CPrivateSendClient::JoinExistingQueue -- connected (from queue), sending DSACCEPT: nSessionDenom: %d (%s), addr=%s\n",
917 pnodeFound->Release();
921 LogPrintf(
"CPrivateSendClient::JoinExistingQueue -- can't connect, addr=%s\n", infoMn.addr.ToString());
935 std::vector<CTxIn> vecTxIn;
939 LogPrintf(
"CPrivateSendClient::StartNewQueue -- Can't mix: no compatible inputs found!\n");
948 LogPrintf(
"CPrivateSendClient::StartNewQueue -- Can't find random masternode!\n");
955 LogPrintf(
"CPrivateSendClient::StartNewQueue -- Too early to mix on this masternode!" 956 " masternode=%s addr=%s nLastDsq=%d CountEnabled/5=%d nDsqCount=%d\n",
963 CNode* pnodeFound = NULL;
964 bool fDisconnect =
false;
967 if(pnodeFound->fDisconnect) {
970 pnodeFound->AddRef();
979 LogPrintf(
"CPrivateSendClient::StartNewQueue -- attempt %d connection to Masternode %s\n", nTries, infoMn.addr.ToString());
982 LogPrintf(
"CPrivateSendClient::StartNewQueue -- connected, addr=%s\n", infoMn.addr.ToString());
985 std::vector<CAmount> vecAmounts;
993 LogPrintf(
"CPrivateSendClient::StartNewQueue -- connected, sending DSACCEPT, nSessionDenom: %d (%s)\n",
999 pnodeFound->Release();
1003 LogPrintf(
"CPrivateSendClient::StartNewQueue -- can't connect, addr=%s\n", infoMn.addr.ToString());
1013 std::string strError;
1014 std::vector<CTxIn> vecTxInRet;
1015 std::vector<CTxOut> vecTxOutRet;
1021 LogPrintf(
"CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, success\n", i);
1024 LogPrint(
"privatesend",
"CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for %d rounds, error: %s\n", i, strError);
1029 LogPrintf(
"CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for all rounds, success\n");
1034 LogPrintf(
"CPrivateSendClient::SubmitDenominate -- Running PrivateSend denominate for all rounds, error: %s\n", strError);
1042 strErrorRet =
"Wallet is not initialized";
1047 strErrorRet =
"Wallet locked, unable to create transaction!";
1052 strErrorRet =
"Already have pending entries in the PrivateSend pool";
1058 vecTxOutRet.clear();
1061 std::vector<CTxIn> vecTxIn;
1062 std::vector<COutput>
vCoins;
1070 std::vector<int> vecBits;
1072 strErrorRet =
"Incorrect session denom";
1077 if (nMinRounds >= 0 && !fSelected) {
1078 strErrorRet =
"Can't select current denominated inputs";
1082 LogPrintf(
"CPrivateSendClient::PrepareDenominate -- max value: %f\n", (
double)nValueIn/
COIN);
1086 BOOST_FOREACH(
CTxIn txin, vecTxIn) {
1091 CAmount nValueLeft = nValueIn;
1099 while (nStep < nStepsMax) {
1100 BOOST_FOREACH(
int nBit, vecBits) {
1101 CAmount nValueDenom = vecStandardDenoms[nBit];
1102 if (nValueLeft - nValueDenom < 0)
continue;
1105 std::vector<CTxIn>::iterator it = vecTxIn.begin();
1106 std::vector<COutput>::iterator it2 =
vCoins.begin();
1107 while (it2 !=
vCoins.end()) {
1109 if ((*it2).tx->vout[(*it2).i].nValue == nValueDenom) {
1111 vecTxInRet.push_back(*it);
1119 CTxOut txout(nValueDenom, scriptDenom);
1120 vecTxOutRet.push_back(txout);
1123 nValueLeft -= nValueDenom;
1132 if(nValueLeft == 0)
break;
1139 BOOST_FOREACH(
CTxIn txin, vecTxIn) {
1147 BOOST_FOREACH(
CTxIn txin, vecTxInRet) {
1151 strErrorRet =
"Can't make current denominated outputs";
1162 std::vector<CompactTallyItem> vecTally;
1164 LogPrint(
"privatesend",
"CPrivateSendClient::MakeCollateralAmounts -- SelectCoinsGrouppedByAddresses can't find any inputs!\n");
1181 LogPrintf(
"CPrivateSendClient::MakeCollateralAmounts -- ERROR: Can't make collaterals!\n");
1196 int nChangePosRet = -1;
1197 std::string strFail =
"";
1198 std::vector<CRecipient> vecSend;
1224 LogPrintf(
"CPrivateSendClient::MakeCollateralAmounts -- ONLY_NONDENOMINATED_NOT1000IFMN Error: %s\n", strFail);
1226 if(fTryDenominated) {
1231 LogPrintf(
"CPrivateSendClient::MakeCollateralAmounts -- ONLY_NOT1000IFMN Error: %s\n", strFail);
1242 reservekeyCollateral.
KeepKey();
1248 LogPrintf(
"CPrivateSendClient::MakeCollateralAmounts -- CommitTransaction failed!\n");
1262 std::vector<CompactTallyItem> vecTally;
1264 LogPrint(
"privatesend",
"CPrivateSendClient::CreateDenominated -- SelectCoinsGrouppedByAddresses can't find any inputs!\n");
1275 LogPrintf(
"CPrivateSendClient::CreateDenominated -- failed!\n");
1282 std::vector<CRecipient> vecSend;
1288 LogPrintf(
"CreateDenominated0 nValueLeft: %f\n", (
float)nValueLeft/
COIN);
1292 if(fCreateMixingCollaterals) {
1301 int nOutputsTotal = 0;
1306 BOOST_REVERSE_FOREACH(
CAmount nDenomValue, vecStandardDenoms) {
1327 while(nValueLeft - nDenomValue >= 0 && nOutputs <= 10) {
1334 nValueLeft -= nDenomValue;
1335 LogPrintf(
"CreateDenominated1: totalOutputs: %d, nOutputsTotal: %d, nOutputs: %d, nValueLeft: %f\n", nOutputsTotal + nOutputs, nOutputsTotal, nOutputs, (
float)nValueLeft/
COIN);
1338 nOutputsTotal += nOutputs;
1339 if(nValueLeft == 0)
break;
1341 LogPrintf(
"CreateDenominated2: nOutputsTotal: %d, nValueLeft: %f\n", nOutputsTotal, (
float)nValueLeft/
COIN);
1344 }
while (nOutputsTotal == 0 && !fSkip);
1345 LogPrintf(
"CreateDenominated3: nOutputsTotal: %d, nValueLeft: %f\n", nOutputsTotal, (
float)nValueLeft/
COIN);
1359 int nChangePosRet = -1;
1360 std::string strFail =
"";
1367 LogPrintf(
"CPrivateSendClient::CreateDenominated -- Error: %s\n", strFail);
1372 keyHolderStorageDenom.
KeepAll();
1375 LogPrintf(
"CPrivateSendClient::CreateDenominated -- CommitTransaction failed!\n");
1391 LogPrintf(
"CPrivateSendClient::RelayIn -- found master, relaying message to %s\n", pnode->addr.ToString());
1392 connman.PushMessage(pnode, NetMsgType::DSVIN, entry);
1399 LogPrintf(
"CPrivateSendClient::SetState -- nState: %d, nStateNew: %d\n",
nState, nStateNew);
1420 static bool fOneThread;
1421 if(fOneThread)
return;
1427 unsigned int nTick = 0;
1437 if(nDoAutoNextRun == nTick) {
static CAmount GetMaxCollateralAmount()
masternode_info_t FindRandomNotInVec(const std::vector< COutPoint > &vecToExclude, int nProtocolVersion=-1)
Find a random entry.
CTxDestination destChange
CNode * ConnectNode(CAddress addrConnect, const char *pszDest=NULL, bool fConnectToMasternode=false)
int CountInputsWithAmount(CAmount nInputAmount)
bool fAllowWatchOnly
Includes watch only addresses which match the ISMINE_WATCH_SOLVABLE criteria.
const CKeyHolder & AddKey(CWallet *pwalletIn)
std::string strAutoDenomResult
CMasternodeSync masternodeSync
bool PrepareDenominate(int nMinRounds, int nMaxRounds, std::string &strErrorRet, std::vector< CTxIn > &vecTxInRet, std::vector< CTxOut > &vecTxOutRet)
step 1: prepare denominated inputs and outputs
void MilliSleep(int64_t n)
std::vector< CTxIn > vecTxIn
#define TRY_LOCK(cs, name)
bool SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector< CTxIn > &vecTxInRet, CAmount &nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax) const
static const int DENOMS_COUNT_MAX
CMutableTransaction txMyCollateral
bool JoinExistingQueue(CAmount nBalanceNeedsAnonymized, CConnman &connman)
CCriticalSection cs_wallet
static const CAmount COIN
void RelayIn(const CDarkSendEntry &entry, CConnman &connman)
CKeyHolderStorage keyHolderStorage
static std::string GetDenominationsToString(int nDenom)
std::vector< CAmount > vecDenominationsSkipped
void SetState(PoolState nStateNew)
bool SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector< CTxIn > &vecTxInRet, std::vector< COutput > &vCoinsRet, CAmount &nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax)
static const int PRIVATESEND_KEYS_THRESHOLD_WARNING
bool SubmitDenominate(CConnman &connman)
As a client, submit part of a future mixing transaction to a Masternode to start the process...
bool ForNode(NodeId id, std::function< bool(const CNode *pnode)> cond, std::function< bool(CNode *pnode)> func)
static CAmount GetCollateralAmount()
void Select(const COutPoint &output)
bool CheckAutomaticBackup()
bool HasCollateralInputs(bool fOnlyConfirmed=true) const
std::string ToString() const
static CAmount GetSmallestDenomination()
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransaction &tx, bool fLimitFree, bool *pfMissingInputs, bool fOverrideMempoolLimit, bool fRejectAbsurdFee, bool fDryRun)
void CompletedTransaction(PoolMessage nMessageID)
static const int PRIVATESEND_QUEUE_TIMEOUT
masternode_info_t infoMixingMasternode
std::string ToString(bool fUseGetnameinfo=true) const
void AskForMN(CNode *pnode, const COutPoint &outpoint, CConnman &connman)
Ask (source) node for mnb.
bool CommitTransaction(CWalletTx &wtxNew, CReserveKey &reservekey, CConnman *connman, std::string strCommand="tx")
CAmount GetNeedsToBeAnonymizedBalance(CAmount nMinBalance=0) const
CAmount GetAnonymizableBalance(bool fSkipDenominated=false, bool fSkipUnconfirmed=true) const
void RenameThread(const char *name)
static int GetDenominations(const std::vector< CTxOut > &vecTxOut, bool fSingleRandomDenom=false)
Get the denominations for a list of outputs (returns a bitshifted integer)
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
std::vector< CTxDSIn > vecTxDSIn
bool CheckDiskSpace(uint64_t nAdditionalBytes)
void push_back(const T &value)
bool CreateTransaction(const std::vector< CRecipient > &vecSend, CWalletTx &wtxNew, CReserveKey &reservekey, CAmount &nFeeRet, int &nChangePosRet, std::string &strFailReason, const CCoinControl *coinControl=NULL, bool sign=true, AvailableCoinsType nCoinType=ALL_COINS, bool fUseInstantSend=false)
static const CAmount PRIVATESEND_ENTRY_MAX_SIZE
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
bool CreateDenominated(CConnman &connman)
Create denominations.
void UnlockCoin(COutPoint &output)
static int LogPrint(const char *category, const char *format)
std::string ToString() const
bool fAllowOtherInputs
If false, allows unselected inputs, but requires all selected inputs be used.
bool GetMasternodeInfo(const COutPoint &outpoint, masternode_info_t &mnInfoRet)
std::string strLastMessage
std::vector< COutPoint > vecOutPointLocked
int64_t nTimeLastSuccessfulStep
bool ConvertList(std::vector< CTxIn > vecTxIn, std::vector< CAmount > &vecAmounts)
void CheckPool()
Check for process.
bool IsLocked(bool fForMixing=false) const
static std::string GetMessageByID(PoolMessage nMessageID)
std::string ToString() const
static bool GetDenominationsBits(int nDenom, std::vector< int > &vecBitsRet)
CScript GetScriptForDestination(const CTxDestination &dest)
CMutableTransaction finalMutableTransaction
int size()
Return the number of (unique) Masternodes.
bool IsDenominatedAmount(CAmount nInputAmount) const
bool CreateCollateralTransaction(CMutableTransaction &txCollateral, std::string &strReason)
static const int PRIVATESEND_SIGNING_TIMEOUT
bool SendDenominate(const std::vector< CTxIn > &vecTxIn, const std::vector< CTxOut > &vecTxOut, CConnman &connman)
step 2: send denominated inputs and outputs prepared in step 1
std::vector< CTxOut > vout
bool SelectCoinsGrouppedByAddresses(std::vector< CompactTallyItem > &vecTallyRet, bool fSkipDenominated=true, bool fAnonymizable=true, bool fSkipUnconfirmed=true) const
const char * DSSIGNFINALTX
CPrivateSendClient privateSendClient
bool GetReservedKey(CPubKey &pubkey, bool fInternalIn)
static vector< COutput > vCoins
std::vector< CDarkSendEntry > vecEntries
int CountEnabled(int nProtocolVersion=-1)
static std::vector< CAmount > GetStandardDenominations()
int GetEntriesCount() const
static CAmount GetMaxPoolAmount()
bool AllowMixing(const COutPoint &outpoint)
std::string ToString() const
CAmount GetDenominatedBalance(bool unconfirmed=false) const
const uint256 & GetHash() const
void ProcessMessage(CNode *pfrom, std::string &strCommand, CDataStream &vRecv, CConnman &connman)
static int GetMaxPoolTransactions()
Get the maximum number of transactions for the pool.
std::vector< COutPoint > vecMasternodesUsed
static const int PRIVATESEND_AUTO_TIMEOUT_MAX
bool CheckPoolStateUpdate(PoolState nStateNew, int nEntriesCountNew, PoolStatusUpdate nStatusUpdate, PoolMessage nMessageID, int nSessionIDNew=0)
Get Masternode updates about the progress of mixing.
bool IsBlockchainSynced()
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION
minimum peer version accepted by mixing pool
bool IsDenomSkipped(CAmount nDenomValue)
std::string GetHex() const
bool IsExpired()
Is this queue expired?
int nCachedLastSuccessBlock
static const int PRIVATESEND_AUTO_TIMEOUT_MIN
static const int PRIVATESEND_KEYS_THRESHOLD_STOP
static bool IsCollateralValid(const CTransaction &txCollateral)
If the collateral is valid given by a client.
CCriticalSection cs_darksend
void PrioritiseTransaction(const uint256 hash, const std::string strHash, double dPriorityDelta, const CAmount &nFeeDelta)
void ThreadCheckPrivateSendClient(CConnman &connman)
int64_t GetTime()
For unit testing.
bool SignFinalTransaction(const CTransaction &finalTransactionNew, CNode *pnode, CConnman &connman)
As a client, check and sign the final transaction.
void LockCoin(COutPoint &output)
static constexpr const CAllNodes AllNodes
bool MakeCollateralAmounts(CConnman &connman)
Split up large inputs or make fee sized inputs.
bool DoAutomaticDenominating(CConnman &connman, bool fDryRun=false)
Passively run mixing in the background according to the configuration in settings.
int nHeight
height of the entry in the chain. The genesis block has height 0
const char * DSSTATUSUPDATE
std::string ToStringShort() const
void UpdatedBlockTip(const CBlockIndex *pindex)
bool SignSignature(const CKeyStore &keystore, const CScript &fromPubKey, CMutableTransaction &txTo, unsigned int nIn, int nHashType)
bool IsMasternodeListSynced()
static int GetDenominationsByAmounts(const std::vector< CAmount > &vecAmount)
Get the denominations for a specific amount of dash.
int64_t nKeysLeftSinceAutoBackup
static void CheckDSTXes(int nHeight)
bool WaitForAnotherBlock()
bool AutoBackupWallet(CWallet *wallet, std::string strWalletFile, std::string &strBackupWarning, std::string &strBackupError)
void PushMessage(CNode *pnode, const std::string &sCommand, Args &&... args)
std::atomic< int > nVersion
std::string _(const char *psz)
std::vector< CTxDSOut > vecTxDSOut
CScript GetScriptForDestination() const
bool fPrivateSendMultiSession
bool StartNewQueue(CAmount nValueMin, CAmount nBalanceNeedsAnonymized, CConnman &connman)
std::vector< CDarksendQueue > vecDarksendQueue
void NewBlock()
Process a new block.