File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,12 @@ class ChainImpl : public Chain
190
190
LOCK (::mempool.cs );
191
191
return IsRBFOptIn (tx, ::mempool);
192
192
}
193
+ bool hasDescendantsInMempool (const uint256& txid) override
194
+ {
195
+ LOCK (::mempool.cs );
196
+ auto it_mp = ::mempool.mapTx .find (txid);
197
+ return it_mp != ::mempool.mapTx .end () && it_mp->GetCountWithDescendants () > 1 ;
198
+ }
193
199
};
194
200
195
201
} // namespace
Original file line number Diff line number Diff line change @@ -135,6 +135,9 @@ class Chain
135
135
136
136
// ! Check if transaction is RBF opt in.
137
137
virtual RBFTransactionState isRBFOptIn (const CTransaction& tx) = 0;
138
+
139
+ // ! Check if transaction has descendants in mempool.
140
+ virtual bool hasDescendantsInMempool (const uint256& txid) = 0;
138
141
};
139
142
140
143
// ! Interface to let node manage chain clients (wallets, or maybe tools for
Original file line number Diff line number Diff line change @@ -27,9 +27,7 @@ static feebumper::Result PreconditionChecks(interfaces::Chain::Lock& locked_chai
27
27
}
28
28
29
29
{
30
- LOCK (mempool.cs );
31
- auto it_mp = mempool.mapTx .find (wtx.GetHash ());
32
- if (it_mp != mempool.mapTx .end () && it_mp->GetCountWithDescendants () > 1 ) {
30
+ if (wallet->chain ().hasDescendantsInMempool (wtx.GetHash ())) {
33
31
errors.push_back (" Transaction has descendants in the mempool" );
34
32
return feebumper::Result::INVALID_PARAMETER;
35
33
}
You can’t perform that action at this time.
0 commit comments