aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-07-28 19:34:54 -0400
committerRussell Yanofsky <russ@yanofsky.org>2019-02-22 15:43:02 -0400
commit6d6bcc77c058fbcfd39c7e3050bbe82fc89024cf (patch)
treec1c287c2912931607c545c5875029a64c65265f5 /src/interfaces
parent00dfb2a440b94a24b61cafb519fb122f6a0ae176 (diff)
Remove use of g_connman / PushInventory in wallet code
This commit does not change behavior.
Diffstat (limited to 'src/interfaces')
-rw-r--r--src/interfaces/chain.cpp6
-rw-r--r--src/interfaces/chain.h3
-rw-r--r--src/interfaces/wallet.cpp2
3 files changed, 10 insertions, 1 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index 8493c5de70..4abb1e638f 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -11,6 +11,7 @@
#include <policy/policy.h>
#include <policy/rbf.h>
#include <primitives/block.h>
+#include <protocol.h>
#include <sync.h>
#include <threadsafety.h>
#include <txmempool.h>
@@ -199,6 +200,11 @@ public:
auto it_mp = ::mempool.mapTx.find(txid);
return it_mp != ::mempool.mapTx.end() && it_mp->GetCountWithDescendants() > 1;
}
+ void relayTransaction(const uint256& txid) override
+ {
+ CInv inv(MSG_TX, txid);
+ g_connman->ForEachNode([&inv](CNode* node) { node->PushInventory(inv); });
+ }
void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) override
{
::mempool.GetTransactionAncestry(txid, ancestors, descendants);
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 44a0b1743e..b4a458cba6 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -141,6 +141,9 @@ public:
//! Check if transaction has descendants in mempool.
virtual bool hasDescendantsInMempool(const uint256& txid) = 0;
+ //! Relay transaction.
+ virtual void relayTransaction(const uint256& txid) = 0;
+
//! Calculate mempool ancestor and descendant counts for the given transaction.
virtual void getTransactionAncestry(const uint256& txid, size_t& ancestors, size_t& descendants) = 0;
diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp
index f3a0b416db..7abbee0912 100644
--- a/src/interfaces/wallet.cpp
+++ b/src/interfaces/wallet.cpp
@@ -56,7 +56,7 @@ public:
auto locked_chain = m_wallet.chain().lock();
LOCK(m_wallet.cs_wallet);
CValidationState state;
- if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), m_key, g_connman.get(), state)) {
+ if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), m_key, state)) {
reject_reason = state.GetRejectReason();
return false;
}