Skip to content

Commit ea0a7ec

Browse files
committed
Remove deprecated bumpfee behavior
1 parent 9158d6f commit ea0a7ec

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3449,10 +3449,7 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
34493449
CWallet* const pwallet = wallet.get();
34503450

34513451
if (pwallet->IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS) && !want_psbt) {
3452-
if (!pwallet->chain().rpcEnableDeprecated("bumpfee")) {
3453-
throw JSONRPCError(RPC_METHOD_DEPRECATED, "Using bumpfee with wallets that have private keys disabled is deprecated. Use psbtbumpfee instead or restart bitcoind with -deprecatedrpc=bumpfee. This functionality will be removed in 0.22");
3454-
}
3455-
want_psbt = true;
3452+
throw JSONRPCError(RPC_WALLET_ERROR, "bumpfee is not available with wallets that have private keys disabled. Use psbtbumpfee instead.");
34563453
}
34573454

34583455
RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VOBJ});

test/functional/rpc_deprecated.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""Test deprecation of RPC calls."""
66
from test_framework.test_framework import BitcoinTestFramework
7-
from test_framework.util import assert_raises_rpc_error, find_vout_for_address
87

98
class DeprecatedRpcTest(BitcoinTestFramework):
109
def set_test_params(self):
@@ -24,37 +23,7 @@ def run_test(self):
2423
# assert_raises_rpc_error(-32, 'The wallet generate rpc method is deprecated', self.nodes[0].rpc.generate, 1)
2524
# self.nodes[1].generate(1)
2625

27-
if self.is_wallet_compiled():
28-
self.log.info("Test bumpfee RPC")
29-
self.nodes[0].generate(101)
30-
self.nodes[0].createwallet(wallet_name='nopriv', disable_private_keys=True)
31-
noprivs0 = self.nodes[0].get_wallet_rpc('nopriv')
32-
w0 = self.nodes[0].get_wallet_rpc(self.default_wallet_name)
33-
self.nodes[1].createwallet(wallet_name='nopriv', disable_private_keys=True)
34-
noprivs1 = self.nodes[1].get_wallet_rpc('nopriv')
35-
36-
address = w0.getnewaddress()
37-
desc = w0.getaddressinfo(address)['desc']
38-
change_addr = w0.getrawchangeaddress()
39-
change_desc = w0.getaddressinfo(change_addr)['desc']
40-
txid = w0.sendtoaddress(address=address, amount=10)
41-
vout = find_vout_for_address(w0, txid, address)
42-
self.nodes[0].generate(1)
43-
rawtx = w0.createrawtransaction([{'txid': txid, 'vout': vout}], {w0.getnewaddress(): 5}, 0, True)
44-
rawtx = w0.fundrawtransaction(rawtx, {'changeAddress': change_addr})
45-
signed_tx = w0.signrawtransactionwithwallet(rawtx['hex'])['hex']
46-
47-
noprivs0.importmulti([{'desc': desc, 'timestamp': 0}, {'desc': change_desc, 'timestamp': 0, 'internal': True}])
48-
noprivs1.importmulti([{'desc': desc, 'timestamp': 0}, {'desc': change_desc, 'timestamp': 0, 'internal': True}])
49-
50-
txid = w0.sendrawtransaction(signed_tx)
51-
self.sync_all()
52-
53-
assert_raises_rpc_error(-32, 'Using bumpfee with wallets that have private keys disabled is deprecated. Use psbtbumpfee instead or restart bitcoind with -deprecatedrpc=bumpfee. This functionality will be removed in 0.22', noprivs0.bumpfee, txid)
54-
bumped_psbt = noprivs1.bumpfee(txid)
55-
assert 'psbt' in bumped_psbt
56-
else:
57-
self.log.info("No tested deprecated RPC methods")
26+
self.log.info("No tested deprecated RPC methods")
5827

5928
if __name__ == '__main__':
6029
DeprecatedRpcTest().main()

test/functional/wallet_bumpfee.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@ def test_watchonly_psbt(self, peer_node, rbf_node, dest_address):
425425
original_txid = watcher.sendrawtransaction(psbt_final["hex"])
426426
assert_equal(len(watcher.decodepsbt(psbt)["tx"]["vin"]), 1)
427427

428+
# bumpfee can't be used on watchonly wallets
429+
assert_raises_rpc_error(-4, "bumpfee is not available with wallets that have private keys disabled. Use psbtbumpfee instead.", watcher.bumpfee, original_txid)
430+
428431
# Bump fee, obnoxiously high to add additional watchonly input
429432
bumped_psbt = watcher.psbtbumpfee(original_txid, {"fee_rate": HIGH})
430433
assert_greater_than(len(watcher.decodepsbt(bumped_psbt['psbt'])["tx"]["vin"]), 1)

0 commit comments

Comments
 (0)