diff options
author | Antoine Riard <ariard@student.42.fr> | 2019-10-24 12:53:57 -0400 |
---|---|---|
committer | Antoine Riard <ariard@student.42.fr> | 2019-11-06 11:35:39 -0500 |
commit | 9700fcb47feca9d78e005b8d18b41148c8f6b25f (patch) | |
tree | b6e966d1a17f966139975649c6e125405174cbfc /src/wallet/wallet.h | |
parent | 5aacc3eff15b9b5bdc951f1e274f00d581f63bce (diff) |
Replace CWalletTx::SetConf by Confirmation initialization list
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 7c22f06e2c..10a3e17f47 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -361,9 +361,10 @@ public: * where they instead point to block hash and index of the deepest conflicting tx. */ struct Confirmation { - Status status = UNCONFIRMED; - uint256 hashBlock = uint256(); - int nIndex = 0; + Status status; + uint256 hashBlock; + int nIndex; + Confirmation(Status s = UNCONFIRMED, uint256 h = uint256(), int i = 0) : status(s), hashBlock(h), nIndex(i) {} }; Confirmation m_confirm; @@ -491,8 +492,6 @@ public: // in place. std::set<uint256> GetConflicts() const NO_THREAD_SAFETY_ANALYSIS; - void SetConf(Status status, const uint256& block_hash, int posInBlock); - /** * Return depth of transaction in blockchain: * <0 : conflicts with a transaction this deep in the blockchain @@ -642,7 +641,7 @@ private: * Abandoned state should probably be more carefully tracked via different * posInBlock signals or by checking mempool presence when necessary. */ - bool AddToWalletIfInvolvingMe(const CTransactionRef& tx, CWalletTx::Status status, const uint256& block_hash, int posInBlock, bool fUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + bool AddToWalletIfInvolvingMe(const CTransactionRef& tx, CWalletTx::Confirmation confirm, bool fUpdate) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); /* Mark a transaction (and its in-wallet descendants) as conflicting with a particular block. */ void MarkConflicted(const uint256& hashBlock, const uint256& hashTx); @@ -654,7 +653,7 @@ private: /* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected/ScanForWalletTransactions. * Should be called with non-zero block_hash and posInBlock if this is for a transaction that is included in a block. */ - void SyncTransaction(const CTransactionRef& tx, CWalletTx::Status status, const uint256& block_hash, int posInBlock = 0, bool update_tx = true) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); + void SyncTransaction(const CTransactionRef& tx, CWalletTx::Confirmation confirm, bool update_tx = true) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); std::atomic<uint64_t> m_wallet_flags{0}; |