| 17 | } |
| 18 | |
| 19 | bool IsRBFOptIn(const CTxMemPoolEntry &entry, CTxMemPool &pool) |
| 20 | { |
| 21 | AssertLockHeld(pool.cs); |
| 22 | |
| 23 | CTxMemPool::setEntries setAncestors; |
| 24 | |
| 25 | // First check the transaction itself. |
| 26 | if (SignalsOptInRBF(entry.GetTx())) { |
| 27 | return true; |
| 28 | } |
| 29 | |
| 30 | // If this transaction is not in our mempool, then we can't be sure |
| 31 | // we will know about all its inputs. |
| 32 | if (!pool.exists(entry.GetTx().GetHash())) { |
| 33 | throw std::runtime_error("Cannot determine RBF opt-in signal for non-mempool transaction\n"); |
| 34 | } |
| 35 | |
| 36 | // If all the inputs have nSequence >= maxint-1, it still might be |
| 37 | // signaled for RBF if any unconfirmed parents have signaled. |
| 38 | uint64_t noLimit = std::numeric_limits<uint64_t>::max(); |
| 39 | std::string dummy; |
| 40 | pool.CalculateMemPoolAncestors(entry, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false); |
| 41 | |
| 42 | for (CTxMemPool::txiter it : setAncestors) { |
| 43 | if (SignalsOptInRBF(it->GetTx())) { |
| 44 | return true; |
| 45 | } |
| 46 | } |
| 47 | return false; |
| 48 | } |
| 49 |
nothing calls this directly
no test coverage detected