mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Remove use of g_connman / PushInventory in wallet code
This commit does not change behavior.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user