mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02: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:
parent
453b4813eb
commit
1c6a73abbd
5 changed files with 26 additions and 18 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue