mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
[wallet] Keep track of the best block time in the wallet
Move nTimeBestReceived (which is only used for wallet rebroadcasts) into the wallet.
This commit is contained in:
@@ -202,8 +202,12 @@ public:
|
||||
{
|
||||
m_notifications->BlockDisconnected(*block);
|
||||
}
|
||||
void UpdatedBlockTip(const CBlockIndex* index, const CBlockIndex* fork_index, bool is_ibd) override
|
||||
{
|
||||
m_notifications->UpdatedBlockTip();
|
||||
}
|
||||
void ChainStateFlushed(const CBlockLocator& locator) override { m_notifications->ChainStateFlushed(locator); }
|
||||
void ResendWalletTransactions(int64_t best_block_time, CConnman*) override
|
||||
void ResendWalletTransactions(CConnman*) override
|
||||
{
|
||||
// `cs_main` is always held when this method is called, so it is safe to
|
||||
// call `assumeLocked`. This is awkward, and the `assumeLocked` method
|
||||
@@ -211,7 +215,7 @@ public:
|
||||
// is replaced by a wallet timer as suggested in
|
||||
// https://github.com/bitcoin/bitcoin/issues/15619
|
||||
auto locked_chain = m_chain.assumeLocked();
|
||||
m_notifications->ResendWalletTransactions(*locked_chain, best_block_time);
|
||||
m_notifications->ResendWalletTransactions(*locked_chain);
|
||||
}
|
||||
Chain& m_chain;
|
||||
Chain::Notifications* m_notifications;
|
||||
|
||||
@@ -256,8 +256,9 @@ public:
|
||||
virtual void TransactionRemovedFromMempool(const CTransactionRef& ptx) {}
|
||||
virtual void BlockConnected(const CBlock& block, const std::vector<CTransactionRef>& tx_conflicted) {}
|
||||
virtual void BlockDisconnected(const CBlock& block) {}
|
||||
virtual void UpdatedBlockTip() {}
|
||||
virtual void ChainStateFlushed(const CBlockLocator& locator) {}
|
||||
virtual void ResendWalletTransactions(Lock& locked_chain, int64_t best_block_time) {}
|
||||
virtual void ResendWalletTransactions(Lock& locked_chain) {}
|
||||
};
|
||||
|
||||
//! Register handler for notifications.
|
||||
|
||||
Reference in New Issue
Block a user