mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[refactor] Add helper for retrieving mempool entry
In places where the iterator is only needed for accessing the actual entry, it should not be required to first retrieve the iterator.
This commit is contained in:
@@ -648,8 +648,9 @@ public:
|
||||
{
|
||||
if (!m_node.mempool) return false;
|
||||
LOCK(m_node.mempool->cs);
|
||||
auto it = m_node.mempool->GetIter(txid);
|
||||
return it && (*it)->GetCountWithDescendants() > 1;
|
||||
const auto entry{m_node.mempool->GetEntry(Txid::FromUint256(txid))};
|
||||
if (entry == nullptr) return false;
|
||||
return entry->GetCountWithDescendants() > 1;
|
||||
}
|
||||
bool broadcastTransaction(const CTransactionRef& tx,
|
||||
const CAmount& max_tx_fee,
|
||||
|
||||
Reference in New Issue
Block a user