MCPcopy Create free account
hub / github.com/LUX-Core/lux / IsRBFOptIn

Function IsRBFOptIn

src/rbf.cpp:19–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19bool 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

Callers

nothing calls this directly

Calls 5

SignalsOptInRBFFunction · 0.85
maxFunction · 0.85
existsMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected