mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 09:12:47 +02:00
wallet, rpc, test: Remove deprecated getunconfirmedbalance
This commit is contained in:
@@ -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{
|
||||
|
@@ -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},
|
||||
|
@@ -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'))
|
||||
|
||||
|
Reference in New Issue
Block a user