MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / IsRBFOptIn

Function IsRBFOptIn

src/policy/rbf.cpp:17–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17RBFTransactionState IsRBFOptIn(const CTransaction &tx, CTxMemPool &pool)
18{
19 AssertLockHeld(pool.cs);
20
21 CTxMemPool::setEntries setAncestors;
22
23 // First check the transaction itself.
24 if (SignalsOptInRBF(tx)) {
25 return RBFTransactionState::REPLACEABLE_BIP125;
26 }
27
28 // If this transaction is not in our mempool, then we can't be sure
29 // we will know about all its inputs.
30 if (!pool.exists(tx.GetHash())) {
31 return RBFTransactionState::UNKNOWN;
32 }
33
34 // If all the inputs have nSequence >= maxint-1, it still might be
35 // signaled for RBF if any unconfirmed parents have signaled.
36 uint64_t noLimit = std::numeric_limits<uint64_t>::max();
37 std::string dummy;
38 CTxMemPoolEntry entry = *pool.mapTx.find(tx.GetHash());
39 pool.CalculateMemPoolAncestors(entry, setAncestors, noLimit, noLimit, noLimit, noLimit, dummy, false);
40
41 for (CTxMemPool::txiter it : setAncestors) {
42 if (SignalsOptInRBF(it->GetTx())) {
43 return RBFTransactionState::REPLACEABLE_BIP125;
44 }
45 }
46 return RBFTransactionState::FINAL;
47}

Callers 1

WalletTxToJSONFunction · 0.85

Calls 6

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

Tested by

no test coverage detected