Skip to content

Commit 1c7ef0a

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#25262: test: Set maxfeerate=0 in MiniWallet sendrawtransaction()
fafaad9 test: Set maxfeerate=0 in MiniWallet sendrawtransaction() (MacroFake) Pull request description: It should be safe to set, because MiniWallet will only ever deal with test transactions, so loss-of-funds is not a reason to keep the feerate check. It is beneficial to set, as it makes tests less verbose to write. Also, it may speed up tests, as the fee-check can be skipped: bitcoin/bitcoin#25087 (comment) ACKs for top commit: michaelfolkson: ACK fafaad9 theStack: Code-review ACK fafaad9 Tree-SHA512: 94c5c163595207a295c7b21f0127d669a9307f6f8b1de5e043d43c52a6714076e2fdce65f2644308a2b90c679642c94f771dab1ff8bc5c0c8b1f5013324b3902
2 parents 86cc31d + fafaad9 commit 1c7ef0a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/functional/mempool_accept.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def run_test(self):
7676
tx.vout[0].nValue = int(0.3 * COIN)
7777
tx.vout[1].nValue = int(49 * COIN)
7878
raw_tx_in_block = tx.serialize().hex()
79-
txid_in_block = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_in_block, maxfeerate=0)
79+
txid_in_block = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_in_block)
8080
self.generate(node, 1)
8181
self.mempool_size = 0
8282
self.check_mempool_result(
@@ -166,7 +166,7 @@ def run_test(self):
166166
tx.vin[1].prevout = COutPoint(hash=int(txid_1, 16), n=0)
167167
tx.vout[0].nValue = int(0.1 * COIN)
168168
raw_tx_spend_both = tx.serialize().hex()
169-
txid_spend_both = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_spend_both, maxfeerate=0)
169+
txid_spend_both = self.wallet.sendrawtransaction(from_node=node, tx_hex=raw_tx_spend_both)
170170
self.generate(node, 1)
171171
self.mempool_size = 0
172172
# Now see if we can add the coins back to the utxo set by sending the exact txs again

test/functional/test_framework/wallet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ def create_self_transfer(self, *, fee_rate=Decimal("0.003"), from_node=None, utx
277277

278278
return {'txid': tx.rehash(), 'wtxid': tx.getwtxid(), 'hex': tx_hex, 'tx': tx}
279279

280-
def sendrawtransaction(self, *, from_node, tx_hex, **kwargs):
281-
txid = from_node.sendrawtransaction(hexstring=tx_hex, **kwargs)
280+
def sendrawtransaction(self, *, from_node, tx_hex, maxfeerate=0, **kwargs):
281+
txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)
282282
self.scan_tx(from_node.decoderawtransaction(tx_hex))
283283
return txid
284284

0 commit comments

Comments
 (0)