Skip to content

Commit

Permalink
[policy] remove BIP125 Rule #2
Browse files Browse the repository at this point in the history
  • Loading branch information
glozow committed Sep 28, 2021
1 parent d8e45bb commit 3fcdc19
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
5 changes: 0 additions & 5 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,11 +793,6 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws)
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY,
"too many potential replacements", *err_string);
}

if (const auto err_string{HasNoNewUnconfirmed(tx, m_pool, setIterConflicting)}) {
return state.Invalid(TxValidationResult::TX_MEMPOOL_POLICY,
"replacement-adds-unconfirmed", *err_string);
}
if (const auto err_string{CheckAncestorScores(ws.m_modified_fees, nSize,
ws.m_ancestors, ws.m_all_conflicting)}) {
// Bypass BIP125 Rule #2 under the condition that the replacement transaction has a higher
Expand Down
22 changes: 0 additions & 22 deletions test/functional/feature_rbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ def run_test(self):
self.log.info("Running test spends of conflicting outputs...")
self.test_spends_of_conflicting_outputs()

self.log.info("Running test new unconfirmed inputs...")
self.test_new_unconfirmed_inputs()

self.log.info("Running test too many replacements...")
self.test_too_many_replacements()

Expand Down Expand Up @@ -341,25 +338,6 @@ def test_spends_of_conflicting_outputs(self):
# This will raise an exception
assert_raises_rpc_error(-26, "bad-txns-spends-conflicting-tx", self.nodes[0].sendrawtransaction, tx2_hex, 0)

def test_new_unconfirmed_inputs(self):
"""Replacements that add new unconfirmed inputs are rejected"""
confirmed_utxo = self.make_utxo(self.nodes[0], int(1.1 * COIN))
unconfirmed_utxo = self.make_utxo(self.nodes[0], int(0.1 * COIN), False)

tx1 = CTransaction()
tx1.vin = [CTxIn(confirmed_utxo)]
tx1.vout = [CTxOut(1 * COIN, DUMMY_P2WPKH_SCRIPT)]
tx1_hex = tx1.serialize().hex()
self.nodes[0].sendrawtransaction(tx1_hex, 0)

tx2 = CTransaction()
tx2.vin = [CTxIn(confirmed_utxo), CTxIn(unconfirmed_utxo)]
tx2.vout = tx1.vout
tx2_hex = tx2.serialize().hex()

# This will raise an exception
assert_raises_rpc_error(-26, "replacement-adds-unconfirmed", self.nodes[0].sendrawtransaction, tx2_hex, 0)

def test_too_many_replacements(self):
"""Replacements that evict too many transactions are rejected"""
# Try directly replacing more than MAX_REPLACEMENT_LIMIT
Expand Down

0 comments on commit 3fcdc19

Please sign in to comment.