diff options
author | John Newbery <john@johnnewbery.com> | 2019-03-28 13:15:47 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2019-04-09 10:37:49 -0400 |
commit | f463cd107361a172a17e4c5510b06eb8a67aade0 (patch) | |
tree | 713da4c32558cf5acbc57a2805895482a3322a90 /src/wallet/wallet.h | |
parent | f3ecf3025f82f84d42ec463990ff787647cc7bf5 (diff) |
[wallet] Keep track of the best block time in the wallet
Move nTimeBestReceived (which is only used for wallet
rebroadcasts) into the wallet.
Diffstat (limited to 'src/wallet/wallet.h')
-rw-r--r-- | src/wallet/wallet.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index fd274fa375..cef58c6419 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -657,6 +657,8 @@ private: int64_t nNextResend = 0; int64_t nLastResend = 0; bool fBroadcastTransactions = false; + // Local time that the tip block was received. Used to schedule wallet rebroadcasts. + std::atomic<int64_t> m_best_block_time {0}; /** * Used to keep track of spent outpoints, and @@ -926,6 +928,7 @@ public: void TransactionAddedToMempool(const CTransactionRef& tx) override; void BlockConnected(const CBlock& block, const std::vector<CTransactionRef>& vtxConflicted) override; void BlockDisconnected(const CBlock& block) override; + void UpdatedBlockTip() override; int64_t RescanFromTime(int64_t startTime, const WalletRescanReserver& reserver, bool update); struct ScanResult { @@ -946,7 +949,7 @@ public: ScanResult ScanForWalletTransactions(const uint256& first_block, const uint256& last_block, const WalletRescanReserver& reserver, bool fUpdate); void TransactionRemovedFromMempool(const CTransactionRef &ptx) override; void ReacceptWalletTransactions(interfaces::Chain::Lock& locked_chain) EXCLUSIVE_LOCKS_REQUIRED(cs_wallet); - void ResendWalletTransactions(interfaces::Chain::Lock& locked_chain, int64_t nBestBlockTime) override; + void ResendWalletTransactions(interfaces::Chain::Lock& locked_chain) override; struct Balance { CAmount m_mine_trusted{0}; //!< Trusted, at depth=GetBalance.min_depth or more CAmount m_mine_untrusted_pending{0}; //!< Untrusted, but in mempool (pending) |