aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-03-20 17:46:38 -0400
committerJohn Newbery <john@johnnewbery.com>2019-04-09 10:38:13 -0400
commit52b760fc6a9b26e405a0553ee8285b0f03ca1604 (patch)
treea4feae27b0681222a2f2b32e20a307ce089f4cbd /src/interfaces
parentf463cd107361a172a17e4c5510b06eb8a67aade0 (diff)
downloadbitcoin-52b760fc6a9b26e405a0553ee8285b0f03ca1604.tar.xz
[wallet] Schedule tx rebroadcasts in wallet
Removes the now-unused Broadcast/ResendWalletTransactions interface from validationinterface. The wallet_resendwallettransactions.py needs a sleep added at the start to make sure that the rebroadcast scheduler is warmed up before the next block is mined.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chain.cpp11
-rw-r--r--src/interfaces/chain.h4
2 files changed, 4 insertions, 11 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 6c918b73f9..f278e5de95 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -207,16 +207,6 @@ public:
m_notifications->UpdatedBlockTip();
}
void ChainStateFlushed(const CBlockLocator& locator) override { m_notifications->ChainStateFlushed(locator); }
- 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
- // should be able to be removed entirely if `ResendWalletTransactions`
- // 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);
- }
Chain& m_chain;
Chain::Notifications* m_notifications;
};
@@ -351,6 +341,7 @@ public:
CAmount maxTxFee() override { return ::maxTxFee; }
bool getPruneMode() override { return ::fPruneMode; }
bool p2pEnabled() override { return g_connman != nullptr; }
+ bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !IsInitialBlockDownload(); }
bool isInitialBlockDownload() override { return IsInitialBlockDownload(); }
bool shutdownRequested() override { return ShutdownRequested(); }
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 82e2c7eb23..4e0ef49f6c 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -223,6 +223,9 @@ public:
//! Check if p2p enabled.
virtual bool p2pEnabled() = 0;
+ //! Check if the node is ready to broadcast transactions.
+ virtual bool isReadyToBroadcast() = 0;
+
//! Check if in IBD.
virtual bool isInitialBlockDownload() = 0;
@@ -258,7 +261,6 @@ public:
virtual void BlockDisconnected(const CBlock& block) {}
virtual void UpdatedBlockTip() {}
virtual void ChainStateFlushed(const CBlockLocator& locator) {}
- virtual void ResendWalletTransactions(Lock& locked_chain) {}
};
//! Register handler for notifications.