From c3fe85e2d6dd4f251a62a99fd891b0fa370f9712 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Tue, 10 Jun 2025 12:11:07 -0700 Subject: [PATCH] wallet, rpc, test: Remove deprecated getunconfirmedbalance --- src/wallet/rpc/coins.cpp | 23 ----------------------- src/wallet/rpc/wallet.cpp | 2 -- test/functional/wallet_balance.py | 3 --- 3 files changed, 28 deletions(-) diff --git a/src/wallet/rpc/coins.cpp b/src/wallet/rpc/coins.cpp index cce9b26babe..16d93de1216 100644 --- a/src/wallet/rpc/coins.cpp +++ b/src/wallet/rpc/coins.cpp @@ -214,29 +214,6 @@ RPCHelpMan getbalance() }; } -RPCHelpMan getunconfirmedbalance() -{ - return RPCHelpMan{"getunconfirmedbalance", - "DEPRECATED\nIdentical to getbalances().mine.untrusted_pending\n", - {}, - RPCResult{RPCResult::Type::NUM, "", "The balance"}, - RPCExamples{""}, - [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue -{ - const std::shared_ptr pwallet = GetWalletForJSONRPCRequest(request); - if (!pwallet) return UniValue::VNULL; - - // Make sure the results are valid at least up to the most recent block - // the user could have gotten from another RPC command prior to now - pwallet->BlockUntilSyncedToCurrentChain(); - - LOCK(pwallet->cs_wallet); - - return ValueFromAmount(GetBalance(*pwallet).m_mine_untrusted_pending); -}, - }; -} - RPCHelpMan lockunspent() { return RPCHelpMan{ diff --git a/src/wallet/rpc/wallet.cpp b/src/wallet/rpc/wallet.cpp index f1a613bc6bc..a86d92af836 100644 --- a/src/wallet/rpc/wallet.cpp +++ b/src/wallet/rpc/wallet.cpp @@ -956,7 +956,6 @@ RPCHelpMan restorewallet(); RPCHelpMan getreceivedbyaddress(); RPCHelpMan getreceivedbylabel(); RPCHelpMan getbalance(); -RPCHelpMan getunconfirmedbalance(); RPCHelpMan lockunspent(); RPCHelpMan listlockunspent(); RPCHelpMan getbalances(); @@ -1016,7 +1015,6 @@ std::span GetWalletRPCCommands() {"wallet", &getreceivedbyaddress}, {"wallet", &getreceivedbylabel}, {"wallet", &gettransaction}, - {"wallet", &getunconfirmedbalance}, {"wallet", &getbalances}, {"wallet", &getwalletinfo}, {"wallet", &importdescriptors}, diff --git a/test/functional/wallet_balance.py b/test/functional/wallet_balance.py index 62160c635ad..c3d9596b8a0 100755 --- a/test/functional/wallet_balance.py +++ b/test/functional/wallet_balance.py @@ -167,9 +167,6 @@ class WalletTest(BitcoinTestFramework): # TODO: fix getbalance tracking of coin spentness depth assert_equal(self.nodes[0].getbalance(minconf=1), Decimal('0')) assert_equal(self.nodes[1].getbalance(minconf=1), Decimal('0')) - # getunconfirmedbalance - assert_equal(self.nodes[0].getunconfirmedbalance(), Decimal('60')) # output of node 1's spend - assert_equal(self.nodes[1].getunconfirmedbalance(), Decimal('30') - fee_node_1) # Doesn't include output of node 0's send since it was spent test_balances(fee_node_1=Decimal('0.01'))