Skip to content

Conversation

@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 12, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34268.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@glozow glozow force-pushed the 2026-01-29.3-backports branch from 689fccc to 00a8f41 Compare January 13, 2026 00:10
@glozow
Copy link
Member Author

glozow commented Jan 13, 2026

I dropped 113a422 since it was causing a failure and didn't seem necessary to backport.

@glozow glozow force-pushed the 2026-01-29.3-backports branch from 00a8f41 to b7ae655 Compare January 13, 2026 17:10
@glozow glozow marked this pull request as ready for review January 13, 2026 17:10
Copy link
Member

@achow101 achow101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release notes should probably say #34156 and #34215 rather than #34222

Comment on lines 122 to 123
if self.options.descriptors:
self.test_from_me_status_change()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In f70a3dd "test: Test wallet 'from me' status change"

Instead of disabling this test for legacy wallets, the following diff can adapt it to be usable for both wallet types:

diff --git a/test/functional/wallet_listtransactions.py b/test/functional/wallet_listtransactions.py
index 5c2cfbf85d1..6a76bcc5e7c 100755
--- a/test/functional/wallet_listtransactions.py
+++ b/test/functional/wallet_listtransactions.py
@@ -119,8 +119,7 @@ class ListTransactionsTest(BitcoinTestFramework):
         self.run_invalid_parameters_test()
         self.test_op_return()
 
-        if self.options.descriptors:
-            self.test_from_me_status_change()
+        self.test_from_me_status_change()
 
     def run_rbf_opt_in_test(self):
         """Test the opt-in-rbf flag for sent and received transactions."""
@@ -345,8 +344,7 @@ class ListTransactionsTest(BitcoinTestFramework):
         # Run twice, once for a transaction in the mempool, again when it confirms
         for confirm in [False, True]:
             key = get_generate_key()
-            descriptor = descsum_create(f"wpkh({key.privkey})")
-            default_wallet.importdescriptors([{"desc": descriptor, "timestamp": "now"}])
+            default_wallet.importprivkey(key.privkey)
 
             send_res = default_wallet.send(outputs=[{key.p2wpkh_addr: 1}, {wallet.getnewaddress(): 1}])
             assert_equal(send_res["complete"], True)
@@ -370,8 +368,7 @@ class ListTransactionsTest(BitcoinTestFramework):
                 self.nodes[0].setmocktime(int(time.time()) + MAX_FUTURE_BLOCK_TIME + 1)
                 self.generate(self.nodes[0], 10, sync_fun=self.no_op)
 
-            import_res = wallet.importdescriptors([{"desc": descriptor, "timestamp": "now"}])
-            assert_equal(import_res[0]["success"], True)
+            wallet.importprivkey(key.privkey)
             # TODO: We should check that the fee matches, but since the transaction spends inputs
             # not known to the wallet, it is incorrectly calculating the fee.
             # assert_equal(wallet.gettransaction(txid)["fee"], fee)

Comment on lines +66 to +68
if self.options.descriptors:
import_res = wallet.importdescriptors([{"desc": descsum_create(f"addr({ANCHOR_ADDRESS})"), "timestamp": "now"}])
assert_equal(import_res[0]["success"], True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In b605cc8 "test: Add a test for anchor outputs in the wallet"

Using wallet.importaddress(ANCHOR_ADDRESS, rescan=False) instead of importdescriptors here allows this test case to work for both descriptors and legacy wallets.

Comment on lines 120 to 121
if self.options.descriptors:
self.test_cannot_sign_anchors()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In b605cc8 "test: Add a test for anchor outputs in the wallet"

The following diff allows this test to work for both descriptors and legacy wallets

diff --git a/test/functional/wallet_anchor.py b/test/functional/wallet_anchor.py
index 49ec75928c0..0b08986d00d 100755
--- a/test/functional/wallet_anchor.py
+++ b/test/functional/wallet_anchor.py
@@ -92,12 +92,15 @@ class WalletAnchorTest(BitcoinTestFramework):
         for disable_privkeys in [False, True]:
             self.nodes[0].createwallet(wallet_name=f"anchor_spend_{disable_privkeys}", disable_private_keys=disable_privkeys)
             wallet = self.nodes[0].get_wallet_rpc(f"anchor_spend_{disable_privkeys}")
-            import_res = wallet.importdescriptors([
-                {"desc": descsum_create(f"addr({ANCHOR_ADDRESS})"), "timestamp": "now"},
-                {"desc": descsum_create(f"raw({PAY_TO_ANCHOR.hex()})"), "timestamp": "now"}
-            ])
-            assert_equal(import_res[0]["success"], disable_privkeys)
-            assert_equal(import_res[1]["success"], disable_privkeys)
+            if self.options.descriptors:
+                import_res = wallet.importdescriptors([
+                    {"desc": descsum_create(f"addr({ANCHOR_ADDRESS})"), "timestamp": "now"},
+                    {"desc": descsum_create(f"raw({PAY_TO_ANCHOR.hex()})"), "timestamp": "now"}
+                ])
+                assert_equal(import_res[0]["success"], disable_privkeys)
+                assert_equal(import_res[1]["success"], disable_privkeys)
+            else:
+                wallet.importaddress(ANCHOR_ADDRESS)
 
         anchor_txid = self.default_wallet.sendtoaddress(ANCHOR_ADDRESS, 1)
         self.generate(self.nodes[0], 1)
@@ -109,16 +112,19 @@ class WalletAnchorTest(BitcoinTestFramework):
         assert_equal(utxos[0]["address"], ANCHOR_ADDRESS)
         assert_equal(utxos[0]["amount"], 1)
 
-        assert_raises_rpc_error(-4, "Missing solving data for estimating transaction size", wallet.send, [{self.default_wallet.getnewaddress(): 0.9999}])
+        if self.options.descriptors:
+            assert_raises_rpc_error(-4, "Missing solving data for estimating transaction size", wallet.send, [{self.default_wallet.getnewaddress(): 0.9999}])
+            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()])
+        else:
+            assert_raises_rpc_error(-4, "Insufficient funds", wallet.send, [{self.default_wallet.getnewaddress(): 0.9999}])
+            assert_raises_rpc_error(-6, "Total value of UTXO pool too low to pay for transaction. Try using lower feerate or excluding uneconomic UTXOs with 'send_max' option.", wallet.sendall, recipients=[self.default_wallet.getnewaddress()])
         assert_raises_rpc_error(-4, "Error: Private keys are disabled for this wallet", wallet.sendtoaddress, self.default_wallet.getnewaddress(), 0.9999)
         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)
-        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()])
 
     def run_test(self):
         self.default_wallet = self.nodes[0].get_wallet_rpc(self.default_wallet_name)
         self.test_0_value_anchor_listunspent()
-        if self.options.descriptors:
-            self.test_cannot_sign_anchors()
+        self.test_cannot_sign_anchors()
 
 if __name__ == '__main__':
     WalletAnchorTest(__file__).main()

@glozow glozow force-pushed the 2026-01-29.3-backports branch from b7ae655 to 55fd7b9 Compare January 14, 2026 00:04
achow101 and others added 7 commits January 13, 2026 16:40
If something is imported into the wallet, it can change the 'from me'
status of a transaction. This status is only visible through
gettransaction's "fee" field which is only shown for transactions that
are 'from me'.

Github-Pull: bitcoin#33268
Rebased-From: e76c2f7
Instead of checking whether the total amount of inputs known by the
wallet is greater than 0, we should be checking for whether the input is
known by the wallet. This enables us to determine whether a transaction
spends an of output with an amount of 0, which is necessary for marking
0-value dust outputs as spent.

Github-Pull: bitcoin#33268
Rebased-From: 39a7dbd
@glozow glozow force-pushed the 2026-01-29.3-backports branch from 55fd7b9 to 794f666 Compare January 14, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants