Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
•All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
privatesend.cpp
Go to the documentation of this file.
87 return GetAdjustedTime() - nTime > PRIVATESEND_QUEUE_TIMEOUT || nTime - GetAdjustedTime() > PRIVATESEND_QUEUE_TIMEOUT;
117 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBroadcastTx::CheckSignature -- VerifyInsecure() failed\n");
127 if (nConfirmedHeight == -1 || pindex->nHeight < nConfirmedHeight) return false; // not mined yet
183 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseManager::%s -- Removing a queue (%s)\n", __func__, (*it).ToString());
225 bool CPrivateSendBaseSession::IsValidInOuts(const std::vector<CTxIn>& vin, const std::vector<CTxOut>& vout, PoolMessage& nMessageIDRet, bool* fConsumeCollateralRet) const
232 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::%s -- ERROR: inputs vs outputs size mismatch! %d vs %d\n", __func__, vin.size(), vout.size());
241 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::IsValidInOuts -- ERROR: incompatible denom %d (%s) != nSessionDenom %d (%s)\n",
242 nDenom, CPrivateSend::DenominationToString(nDenom), nSessionDenom, CPrivateSend::DenominationToString(nSessionDenom));
248 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::IsValidInOuts -- ERROR: invalid script! scriptPubKey=%s\n", ScriptToAsmStr(txout.scriptPubKey));
254 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::IsValidInOuts -- ERROR: already have this script! scriptPubKey=%s\n", ScriptToAsmStr(txout.scriptPubKey));
276 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::%s -- txin=%s\n", __func__, txin.ToString());
279 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::%s -- ERROR: invalid input!\n", __func__);
287 (coin.nHeight == MEMPOOL_HEIGHT && !llmq::quorumInstantSendManager->IsLocked(txin.prevout.hash))) {
288 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::%s -- ERROR: missing, spent or non-locked mempool input! txin=%s\n", __func__, txin.ToString());
303 LogPrint(BCLog::PRIVATESEND, "CPrivateSendBaseSession::%s -- ERROR: non-zero fees! fees: %lld\n", __func__, nFees);
351 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::IsCollateralValid -- Invalid Script, txCollateral=%s", txCollateral.ToString());
360 if (mempool.isSpent(txin.prevout) || !llmq::quorumInstantSendManager->IsLocked(txin.prevout.hash)) {
361 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::IsCollateralValid -- spent or non-locked mempool input! txin=%s\n", txin.ToString());
368 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::IsCollateralValid -- Unknown inputs in collateral transaction, txCollateral=%s", txCollateral.ToString());
375 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::IsCollateralValid -- did not include enough fees in transaction: fees: %d, txCollateral=%s", nValueOut - nValueIn, txCollateral.ToString());
384 if (!AcceptToMemoryPool(mempool, validationState, MakeTransactionRef(txCollateral), nullptr /* pfMissingInputs */, false /* bypass_limits */, maxTxFee /* nAbsurdFee */, true /* fDryRun */)) {
385 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::IsCollateralValid -- didn't pass AcceptToMemoryPool()\n");
415 - one of standard denominations from vecStandardDenominations based on the provided bitshifted integer
555 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::CheckDSTXes -- mapDSTX.size()=%llu\n", mapDSTX.size());
582 LogPrint(BCLog::PRIVATESEND, "CPrivateSend::%s -- txid=%s, nHeight=%d\n", __func__, tx->GetHash().ToString(), nHeight);
591 void CPrivateSend::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindex, const std::vector<CTransactionRef>& vtxConflicted)
603 void CPrivateSend::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const CBlockIndex* pindexDisconnected)
static void UpdatedBlockTip(const CBlockIndex *pindex)
Definition: privatesend.cpp:558
Definition: privatesend.h:34
CTxMemPool mempool
Definition: privatesend.h:64
Definition: privatesend.h:56
Definition: privatesend.h:49
Definition: privatesend.h:41
static void CheckDSTXes(const CBlockIndex *pindex)
Definition: privatesend.cpp:544
static bool IsDenominatedAmount(CAmount nInputAmount)
Definition: privatesend.cpp:469
uint256 GetSignatureHash() const
Definition: privatesend.cpp:90
Definition: privatesend.h:50
bool CheckSignature(const CBLSPublicKey &blsPubKey) const
Check if we have a valid Masternode address.
Definition: privatesend.cpp:60
std::vector< CPrivateSendEntry > vecEntries
Definition: privatesend.h:364
static void BlockConnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindex, const std::vector< CTransactionRef > &vtxConflicted)
Definition: privatesend.cpp:591
CAmount maxTxFee
Absolute maximum transaction fee (in duffs) used by wallet and mempool (rejects high fee in sendrawtr...
Definition: validation.cpp:247
bool HasChainLock(int nHeight, const uint256 &blockHash)
Definition: quorums_chainlocks.cpp:608
A currently in progress mixing merge and denomination information.
Definition: privatesend.h:215
static int GetMaxPoolParticipants()
Definition: privatesend.h:452
Definition: privatesend.h:51
void PushMessage(CNode *pnode, CSerializedNetMsg &&msg)
Definition: net.cpp:3733
Definition: privatesend.h:39
Definition: privatesend.h:36
bool VerifyInsecure(const CBLSPublicKey &pubKey, const uint256 &hash) const
Definition: bls.cpp:335
Definition: privatesend.h:52
static int AmountToDenomination(CAmount nInputAmount)
Definition: privatesend.cpp:403
CMutableTransaction finalMutableTransaction
Definition: privatesend.h:371
static void NotifyChainLock(const CBlockIndex *pindex)
Definition: privatesend.cpp:565
Definition: privatesend.h:42
Definition: privatesend.h:53
static void BlockDisconnected(const std::shared_ptr< const CBlock > &pblock, const CBlockIndex *pindexDisconnected)
Definition: privatesend.cpp:603
CInstantSendManager * quorumInstantSendManager
Definition: quorums_instantsend.cpp:40
std::unique_ptr< CCoinsViewCache > pcoinsTip
Global variable that points to the active CCoinsView (protected by cs_main)
Definition: validation.cpp:300
static std::vector< CAmount > vecStandardDenominations
Definition: privatesend.h:427
uint32_t nHeight
at which height this containing transaction was included in the active block chain ...
Definition: coins.h:39
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
Definition: hash.h:254
static void UpdateDSTXConfirmedHeight(const CTransactionRef &tx, int nHeight)
Definition: privatesend.cpp:572
static const uint32_t MEMPOOL_HEIGHT
Fake height value used in Coin to signify they are only in the memory pool (since 0...
Definition: txmempool.h:38
static int GetMinPoolParticipants()
Get the minimum/maximum number of participants for the pool.
Definition: privatesend.h:449
Definition: privatesend.h:68
static void InitStandardDenominations()
Definition: privatesend.cpp:316
std::string ScriptToAsmStr(const CScript &script, const bool fAttemptSighashDecode=false)
Create the assembly string representation of a CScript object.
Definition: core_write.cpp:86
static bool IsCollateralValid(const CTransaction &txCollateral)
If the collateral is valid given by a client.
Definition: privatesend.cpp:339
Definition: privatesend.h:45
Definition: privatesend.h:38
bool GetQueueItemAndTry(CPrivateSendQueue &dsqRet)
Definition: privatesend.cpp:191
Definition: privatesend.h:67
Definition: privatesend.h:44
static CPrivateSendBroadcastTx GetDSTX(const uint256 &hash)
Definition: privatesend.cpp:537
Definition: util.h:142
Definition: bls.h:263
Definition: privatesend.h:55
Definition: bls.h:286
bool IsLocked(const uint256 &txHash)
Definition: quorums_instantsend.cpp:1464
std::vector< CPrivateSendQueue > vecPrivateSendQueue
Definition: privatesend.h:403
int64_t nTimeLastSuccessfulStep
Definition: privatesend.h:367
static void TransactionAddedToMempool(const CTransactionRef &tx)
Definition: privatesend.cpp:585
static void AddDSTX(const CPrivateSendBroadcastTx &dstx)
Definition: privatesend.cpp:531
bool IsExpired(const CBlockIndex *pindex)
Definition: privatesend.cpp:124
bool IsTimeOutOfBounds() const
Check if a queue is too old or too far into the future.
Definition: privatesend.cpp:85
Definition: privatesend.h:37
std::string GetStateString() const
Definition: privatesend.cpp:207
static bool IsValidDenomination(int nDenom)
Definition: privatesend.cpp:474
Helper class to store mixing transaction (tx) information.
Definition: privatesend.h:291
Definition: privatesend.h:47
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
bool AcceptToMemoryPool(CTxMemPool &pool, CValidationState &state, const CTransactionRef &tx, bool *pfMissingInputs, bool bypass_limits, const CAmount nAbsurdFee, bool fDryRun)
(try to) add transaction to memory pool
Definition: validation.cpp:890
static const int MIN_PRIVATESEND_PEER_PROTO_VERSION
minimum peer version accepted by mixing pool
Definition: privatesend.h:28
static std::string GetMessageByID(PoolMessage nMessageID)
Definition: privatesend.cpp:479
static std::map< uint256, CPrivateSendBroadcastTx > mapDSTX
Definition: privatesend.h:428
static CAmount GetMaxCollateralAmount()
Definition: privatesend.h:461
bool IsValidInOuts(const std::vector< CTxIn > &vin, const std::vector< CTxOut > &vout, PoolMessage &nMessageIDRet, bool *fConsumeCollateralRet) const
Definition: privatesend.cpp:225
Definition: netmessagemaker.h:12
bool CheckSignature(const CBLSPublicKey &blsPubKey) const
Definition: privatesend.cpp:110
static bool IsCollateralAmount(CAmount nInputAmount)
Definition: privatesend.cpp:393
Definition: privatesend.h:46
Definition: privatesend.h:40
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
AssertLockHeld(g_cs_orphans)
static CAmount DenominationToAmount(int nDenom)
Definition: privatesend.cpp:419
Definition: privatesend.h:43
CCoinsView that brings transactions from a memorypool into view.
Definition: txmempool.h:739
std::unique_ptr< CBLSSecretKey > blsKeyOperator
Definition: activemasternode.h:26
Definition: privatesend.h:66
static std::string DenominationToString(int nDenom)
Definition: privatesend.cpp:453
Definition: privatesend.h:65
Definition: privatesend.h:54
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: util.h:92
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94
Definition: privatesend.h:48
static const size_t PRIVATESEND_ENTRY_MAX_SIZE
Definition: privatesend.h:30
Definition: privatesend.h:35
const uint256 * phashBlock
pointer to the hash of the block, if any. Memory is owned by this CBlockIndex
Definition: chain.h:174