[test] rework/delete feature_rbf tests requiring large clusters
This commit is contained in:
1 parent
435fd56711
commit
edb3e7cdf6
1 file changed
+7
-24
@@ -28,10 +28,8 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
|||||||
self.num_nodes = 2
|
self.num_nodes = 2
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
[
|
[
|
||||||
"-limitancestorcount=50",
|
"-limitancestorcount=64",
|
||||||
"-limitancestorsize=101",
|
"-limitdescendantcount=64",
|
||||||
"-limitdescendantcount=200",
|
|
||||||
"-limitdescendantsize=101",
|
|
||||||
],
|
],
|
||||||
# second node has default mempool parameters
|
# second node has default mempool parameters
|
||||||
[
|
[
|
||||||
@@ -145,7 +143,9 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
|||||||
prevout = tx0_outpoint
|
prevout = tx0_outpoint
|
||||||
remaining_value = initial_nValue
|
remaining_value = initial_nValue
|
||||||
chain_txids = []
|
chain_txids = []
|
||||||
while remaining_value > 1 * COIN:
|
for _ in range(MAX_CLUSTER_LIMIT):
|
||||||
|
if remaining_value <= 1 * COIN:
|
||||||
|
break
|
||||||
remaining_value -= int(0.1 * COIN)
|
remaining_value -= int(0.1 * COIN)
|
||||||
prevout = self.wallet.send_self_transfer(
|
prevout = self.wallet.send_self_transfer(
|
||||||
from_node=self.nodes[0],
|
from_node=self.nodes[0],
|
||||||
@@ -244,25 +244,6 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
|||||||
for txid in tree_txs:
|
for txid in tree_txs:
|
||||||
assert txid not in mempool
|
assert txid not in mempool
|
||||||
|
|
||||||
# Try again, but with more total transactions than the "max txs
|
|
||||||
# double-spent at once" anti-DoS limit.
|
|
||||||
for n in (MAX_REPLACEMENT_LIMIT + 1, MAX_REPLACEMENT_LIMIT * 2):
|
|
||||||
fee = int(0.00001 * COIN)
|
|
||||||
tx0_outpoint = self.make_utxo(self.nodes[0], initial_nValue)
|
|
||||||
tree_txs = list(branch(tx0_outpoint, initial_nValue, n, fee=fee))
|
|
||||||
assert_equal(len(tree_txs), n)
|
|
||||||
|
|
||||||
dbl_tx_hex = self.wallet.create_self_transfer(
|
|
||||||
utxo_to_spend=tx0_outpoint,
|
|
||||||
sequence=0,
|
|
||||||
fee=2 * (Decimal(fee) / COIN) * n,
|
|
||||||
)["hex"]
|
|
||||||
# This will raise an exception
|
|
||||||
assert_raises_rpc_error(-26, "too many potential replacements", self.nodes[0].sendrawtransaction, dbl_tx_hex, 0)
|
|
||||||
|
|
||||||
for txid in tree_txs:
|
|
||||||
self.nodes[0].getrawtransaction(txid)
|
|
||||||
|
|
||||||
def test_replacement_feeperkb(self):
|
def test_replacement_feeperkb(self):
|
||||||
"""Replacement requires fee-per-KB to be higher"""
|
"""Replacement requires fee-per-KB to be higher"""
|
||||||
tx0_outpoint = self.make_utxo(self.nodes[0], int(1.1 * COIN))
|
tx0_outpoint = self.make_utxo(self.nodes[0], int(1.1 * COIN))
|
||||||
@@ -380,6 +361,8 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
|||||||
amount_per_output=split_value,
|
amount_per_output=split_value,
|
||||||
)["new_utxos"]
|
)["new_utxos"]
|
||||||
|
|
||||||
|
self.generate(self.nodes[0], 1)
|
||||||
|
|
||||||
# Now spend each of those outputs individually
|
# Now spend each of those outputs individually
|
||||||
for utxo in splitting_tx_utxos:
|
for utxo in splitting_tx_utxos:
|
||||||
self.wallet.send_self_transfer(
|
self.wallet.send_self_transfer(
|
||||||
|
|||||||
Reference in new issue
Block a user