aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2021-10-20 16:41:45 +0100
committerglozow <gloriajzhao@gmail.com>2021-10-21 16:26:59 +0100
commit4307849256761fe2440d82bbec892d0e8e6b4dd4 (patch)
tree7d32e7727d87b15b4b45a98a446b357a5072570d /src/policy
parentd50fbd4c5b4bc72415854d582cedf94541a46983 (diff)
[mempool] delete exists(uint256) function
Allowing callers to pass in a uint256 (which could be txid or wtxid) but then always assuming that it's a txid is a footgunny interface.
Diffstat (limited to 'src/policy')
-rw-r--r--src/policy/rbf.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/policy/rbf.cpp b/src/policy/rbf.cpp
index 7ac2e22006..7e6b0cf245 100644
--- a/src/policy/rbf.cpp
+++ b/src/policy/rbf.cpp
@@ -22,7 +22,7 @@ RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool)
// If this transaction is not in our mempool, then we can't be sure
// we will know about all its inputs.
- if (!pool.exists(tx.GetHash())) {
+ if (!pool.exists(GenTxid::Txid(tx.GetHash()))) {
return RBFTransactionState::UNKNOWN;
}
@@ -98,7 +98,7 @@ std::optional<std::string> HasNoNewUnconfirmed(const CTransaction& tx,
if (!parents_of_conflicts.count(tx.vin[j].prevout.hash)) {
// Rather than check the UTXO set - potentially expensive - it's cheaper to just check
// if the new input refers to a tx that's in the mempool.
- if (pool.exists(tx.vin[j].prevout.hash)) {
+ if (pool.exists(GenTxid::Txid(tx.vin[j].prevout.hash))) {
return strprintf("replacement %s adds unconfirmed input, idx %d",
tx.GetHash().ToString(), j);
}