@@ -86,7 +86,7 @@ def run_test(self):
86
86
self .test_invalid_parameters (rbf_node , peer_node , dest_address )
87
87
test_segwit_bumpfee_succeeds (self , rbf_node , dest_address )
88
88
test_nonrbf_bumpfee_fails (self , peer_node , dest_address )
89
- test_notmine_bumpfee_fails (self , rbf_node , peer_node , dest_address )
89
+ test_notmine_bumpfee (self , rbf_node , peer_node , dest_address )
90
90
test_bumpfee_with_descendant_fails (self , rbf_node , rbf_node_address , dest_address )
91
91
test_dust_to_fee (self , rbf_node , dest_address )
92
92
test_watchonly_psbt (self , peer_node , rbf_node , dest_address )
@@ -232,7 +232,7 @@ def test_nonrbf_bumpfee_fails(self, peer_node, dest_address):
232
232
self .clear_mempool ()
233
233
234
234
235
- def test_notmine_bumpfee_fails (self , rbf_node , peer_node , dest_address ):
235
+ def test_notmine_bumpfee (self , rbf_node , peer_node , dest_address ):
236
236
self .log .info ('Test that it cannot bump fee if non-owned inputs are included' )
237
237
# here, the rbftx has a peer_node coin and then adds a rbf_node input
238
238
# Note that this test depends upon the RPC code checking input ownership prior to change outputs
@@ -250,8 +250,27 @@ def test_notmine_bumpfee_fails(self, rbf_node, peer_node, dest_address):
250
250
signedtx = rbf_node .signrawtransactionwithwallet (rawtx )
251
251
signedtx = peer_node .signrawtransactionwithwallet (signedtx ["hex" ])
252
252
rbfid = rbf_node .sendrawtransaction (signedtx ["hex" ])
253
+ entry = rbf_node .getmempoolentry (rbfid )
254
+ old_fee = entry ["fees" ]["base" ]
255
+ old_feerate = int (old_fee / entry ["vsize" ] * Decimal (1e8 ))
253
256
assert_raises_rpc_error (- 4 , "Transaction contains inputs that don't belong to this wallet" ,
254
257
rbf_node .bumpfee , rbfid )
258
+
259
+ def finish_psbtbumpfee (psbt ):
260
+ psbt = rbf_node .walletprocesspsbt (psbt )
261
+ psbt = peer_node .walletprocesspsbt (psbt ["psbt" ])
262
+ final = rbf_node .finalizepsbt (psbt ["psbt" ])
263
+ res = rbf_node .testmempoolaccept ([final ["hex" ]])
264
+ assert res [0 ]["allowed" ]
265
+ assert_greater_than (res [0 ]["fees" ]["base" ], old_fee )
266
+
267
+ self .log .info ("Test that psbtbumpfee works for non-owned inputs" )
268
+ psbt = rbf_node .psbtbumpfee (txid = rbfid )
269
+ finish_psbtbumpfee (psbt ["psbt" ])
270
+
271
+ psbt = rbf_node .psbtbumpfee (txid = rbfid , options = {"fee_rate" : old_feerate + 10 })
272
+ finish_psbtbumpfee (psbt ["psbt" ])
273
+
255
274
self .clear_mempool ()
256
275
257
276
0 commit comments