In https://github.com/bitcoin/bitcoin/commit/1cd57c67b10a771d2eb1c2324b241533c0b1f287 “test: Add a test for anchor outputs in the wallet”
While passing the inputs
in this RPC is fine, I feel another frequently used way of calling sendall
RPC could be to not pass the inputs
in the request, in which case the RPC throws Internal bug detected
.
0test_framework.authproxy.JSONRPCException: Internal bug detected: output.input_bytes > 0
1wallet/rpc/spend.cpp:1524 (operator())
2Bitcoin Core v29.99.0-69eeb11bc585
3Please report this issue here: https://github.com/bitcoin/bitcoin/issues
4 (-1)
https://github.com/bitcoin/bitcoin/blob/ba0b4304eceeec52eb3ffd2e7f8bb831ba1ec278/src/wallet/rpc/spend.cpp#L1524
One way to resolve (if the filtering is not done in AvailableCoins instead)
0diff --git a/src/wallet/rpc/spend.cpp b/src/wallet/rpc/spend.cpp
1index 45c85af9b6..d00547a897 100644
2--- a/src/wallet/rpc/spend.cpp
3+++ b/src/wallet/rpc/spend.cpp
4@@ -1521,7 +1521,6 @@ RPCHelpMan sendall()
5 CoinFilterParams coins_params;
6 coins_params.min_amount = 0;
7 for (const COutput& output : AvailableCoins(*pwallet, &coin_control, fee_rate, coins_params).All()) {
8- CHECK_NONFATAL(output.input_bytes > 0);
9 if (send_max && fee_rate.GetFee(output.input_bytes) > output.txout.nValue) {
10 continue;
11 }
12diff --git a/test/functional/wallet_anchor.py b/test/functional/wallet_anchor.py
13index 1d1435145a..49ef34c764 100755
14--- a/test/functional/wallet_anchor.py
15+++ b/test/functional/wallet_anchor.py
16@@ -122,6 +122,7 @@ class WalletAnchorTest(BitcoinTestFramework):
17 assert_raises_rpc_error(-4, "Missing solving data for estimating transaction size", wallet.send, [{self.default_wallet.getnewaddress(): 0.9999}])
18 assert_raises_rpc_error(-4, "Error: Private keys are disabled for this wallet", wallet.sendtoaddress, self.default_wallet.getnewaddress(), 0.9999)
19 assert_raises_rpc_error(-4, "Unable to determine the size of the transaction, the wallet contains unsolvable descriptors", wallet.sendall, recipients=[self.default_wallet.getnewaddress()], inputs=utxos)
20+ assert_raises_rpc_error(-4, "Unable to determine the size of the transaction, the wallet contains unsolvable descriptors", wallet.sendall, recipients=[self.default_wallet.getnewaddress()])
21
22 def run_test(self):
23 self.default_wallet = self.nodes[0].get_wallet_rpc(self.default_wallet_name)