wallet, rpc, test: Remove deprecated getunconfirmedbalance

This commit is contained in:
Ava Chow
2025-06-10 12:11:07 -07:00
parent 0ec255139b
commit c3fe85e2d6
3 changed files with 0 additions and 28 deletions

View File

@@ -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<const CWallet> 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{

View File

@@ -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<const CRPCCommand> GetWalletRPCCommands()
{"wallet", &getreceivedbyaddress},
{"wallet", &getreceivedbylabel},
{"wallet", &gettransaction},
{"wallet", &getunconfirmedbalance},
{"wallet", &getbalances},
{"wallet", &getwalletinfo},
{"wallet", &importdescriptors},

View File

@@ -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'))