Commit Graph

44411 Commits

Author SHA1 Message Date
Ava Chow
572ef0fa43 Merge bitcoin/bitcoin#35212: [29.x] validation: correct lifetime of precomputed tx data
9ad085bd83 validation: correct lifetime of precomputed tx data (Antoine Poinsot)

Pull request description:

  This backports #35209 to the version 29 branch.

ACKs for top commit:
  achow101:
    ACK 9ad085bd83
  theuni:
    ACK 9ad085bd83

Tree-SHA512: e9dd4d43ee348015d3b7b485bef4617c69ad8e0c70589f84a16eb2b1d97bdefd21ce5d72ad6a2d8d25bc90d98f65d53374ca921210cab3b0db773072126459f6
2026-05-06 01:32:52 -07:00
Ava Chow
062863d40f Merge bitcoin/bitcoin#34855: [29.x] Backports
83b46506a1 doc: update release notes for v29.x (fanquake)
18739ec488 ci: unconfine seccomp for i686 no IPC (Lőrinc)
546598b736 multi_index: fix compilation failure with boost >= 1.91 (Cory Fields)
0fb5e167e8 cmake: Migrate away from deprecated SQLite3 target (Daniel Pfeifer)

Pull request description:

  Backports:
  * #34848
  * #35175
  * #35202

ACKs for top commit:
  achow101:
    ACK 83b46506a1
  willcl-ark:
    reACK 83b46506a1

Tree-SHA512: 564ad5e9f9ab1f627bb87f083ba55c5e32af31942b2e365e5889bab6e3e85a957b1c513967fe7e1310ab439d23256f8de39bef25105dbded5514977b6ad81cf9
2026-05-06 01:10:41 -07:00
fanquake
83b46506a1 doc: update release notes for v29.x 2026-05-05 15:13:26 +02:00
Lőrinc
18739ec488 ci: unconfine seccomp for i686 no IPC
Docker 29.4.2 blocks `socketcall(2)` in the default seccomp profile:
https://docs.docker.com/engine/release-notes/29/#2942
https://github.com/moby/profiles/releases/tag/seccomp%2Fv0.2.2
https://github.com/moby/moby/pull/52501

That affects the `i686, no IPC` job because it runs 32-bit Linux test binaries inside Docker.

Add Docker's documented `--security-opt seccomp=unconfined` workaround to this job's `CI_CONTAINER_CAP` - the hook `ci/test/02_run_container.py` already appends to `docker run`.

This restores socket availability for the 32-bit test binaries throughout the job:
https://docs.docker.com/engine/security/seccomp/#run-without-the-default-seccomp-profile

Github-Pull: #35202
Rebased-From: 11c9ef92a8
2026-05-05 15:12:37 +02:00
Antoine Poinsot
9ad085bd83 validation: correct lifetime of precomputed tx data
This makes sure `txsdata` always outlives the Script check queue (since local
objects are destructed in reverse order of construction).

This is the root cause for a security vulnerability reported by Cory Fields in
2024 that could be exploited by crafting an invalid block to cause nodes to
read freed memory. The vulnerability was covertly fixed in commit
`492e1f09943fcb6145c21d470299305a19e17d8b`.

See security advisory for CVE-2024-52911 for more details.

Github-Pull: #35209
Rebased-From: 1ed799fb21
2026-05-05 08:18:58 -04:00
Cory Fields
546598b736 multi_index: fix compilation failure with boost >= 1.91
This effectively reverts a3cb309e7c from PR #30194.

That PR reduced the multi_index type signatures as recommended upstream, but
this is no longer supported as of boost 1.91 because it is no longer necessary.
1.91 drops support for the pre-c++11 work-arounds that bloated the type
signatures to begin with.

The upstream `BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT` define is meant to provide
compatibility with removed features, but it does not work for this case. Using
`indexed_by` directly when defining the `multi_index` (as opposed to inheriting
from it) works with all versions, and avoids the use of the back-compat define.

This is a slight regression when building against boost < 1.91 because the
bloated type signatures are reintroduced in that case, but it's not significant
enough to go to the trouble of introducing version detection and ifdefs.

Github-Pull: #35175
Rebased-From: 0bc9d354df
2026-04-30 15:06:17 +01:00
Daniel Pfeifer
0fb5e167e8 cmake: Migrate away from deprecated SQLite3 target
CMake version 4.3 deprecated the imported target `Sqlite::Sqlite3`.
Use the preferred name `Sqlite3::Sqlite3` instead and provide an
alias for older versions of CMake. Also define the same alias when
using vcpkg.

Github-Pull: #34848
Rebased-From: 498b6eb6b5
2026-03-19 14:36:27 +08:00
merge-script
8d6ebc80ce Merge bitcoin/bitcoin#34680: [29.x] Backports
98ea6caed5 doc: update release notes for v29.x (fanquake)
490cd874a4 netif: fix compilation warning in QueryDefaultGatewayImpl() (MarcoFalke)
98af76f875 wallet: rpc: manpage: fix example missing `fee_rate` argument (SomberNight)
532afe909e doc: Update Guix install for Debian/Ubuntu (MarcoFalke)
5910bd3b5d doc: fix broken bpftrace installation link (jayvaliya)

Pull request description:

  Backports:
  * #34093
  * #34510
  * #34561
  * #34671

ACKs for top commit:
  marcofleon:
    ACK 98ea6caed5

Tree-SHA512: 01d4c4e41f27c98c9f37d6140e0be0e2ec21f147dc82fd8652c16c9c09650fea8a8cbd7df2571cb7f108c4178c8eab8ca992a58f42ac6eab5f74bd97e435efb0
2026-03-09 17:07:07 +00:00
fanquake
98ea6caed5 doc: update release notes for v29.x 2026-02-27 12:12:11 +00:00
MarcoFalke
490cd874a4 netif: fix compilation warning in QueryDefaultGatewayImpl()
```
src/common/netif.cpp:137:51: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'unsigned long' [-Werror,-Wsign-compare]
  137 |         for (nlmsghdr* hdr = (nlmsghdr*)response; NLMSG_OK(hdr, recv_result); hdr = NLMSG_NEXT(hdr, recv_result)) {
      |                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/netlink/netlink.h:220:31: note: expanded from macro 'NLMSG_OK'
  220 | #define NLMSG_OK(_hdr, _len)            NL_ITEM_OK(_hdr, _len, NLMSG_HDRLEN, _NLMSG_LEN)
      |                                         ^                ~~~~  ~~~~~~~~~~~~
/usr/include/netlink/netlink.h:203:10: note: expanded from macro 'NL_ITEM_OK'
  203 |         ((_len) >= _hlen && _LEN_M(_ptr) >= _hlen && _LEN_M(_ptr) <= (_len))
      |           ~~~~  ^  ~~~~~
1 error generated.
```

Happens on FreeBSD 15.0, with the default compiler (Clang 19).

On FreeBSD 14, `/usr/include/netlink/netlink.h` contains:
```
 #define NLMSG_HDRLEN                    ((int)sizeof(struct nlmsghdr))
```

On FreeBSD 15, `/usr/include/netlink/netlink.h` contains:
```
 #define NLMSG_HDRLEN                    (sizeof(struct nlmsghdr))
```

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>

Github-Pull: #34093
Rebased-From: c1361fc42d
2026-02-27 12:10:52 +00:00
SomberNight
98af76f875 wallet: rpc: manpage: fix example missing fee_rate argument
The function signature for the `send` RPC is:
```
send [{"address":amount,...},{"data":"hex"},...] ( conf_target "estimate_mode" fee_rate options version )
```

The last example in the manpage is missing the `fee_rate` arg, but is trying to specify the `options` arg, by index.
The parser confuses the intended `options` arg as the missing `fee_rate` arg.

See:
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
error code: -8
error message:
Cannot specify both conf_target and fee_rate. Please provide either a confirmation target in blocks for automatic fee estimation, or an explicit fee rate.
```
vs
```
$ bitcoin-cli -rpcuser=doggman -rpcpassword=donkey -rpcport=18554 -regtest send '{"bcrt1qusm48zmlzwr32csxdw4ar7atw260h22c9ten9l": 0.1}' 1 economical null '{"add_to_wallet": false, "inputs": [{"txid":"0b7e1a471dc948b7a6187936b16e6d7d9833629b2f9dd8a392eb89928f63aaad", "vout":0}]}'
{
  "psbt": "cHNidP8BAHECAAAAAa2qY4+SieuSo9idL5tiM5h9bW6xNnkYprdIyR1HGn4LAAAAAAD9////AkR2DwQAAAAAFgAUpLDwJu+wFRHLQAgKAb0psk7UVd2AlpgAAAAAABYAFOQ3U4t/E4cVYgZrq9H7q3K0+6lYAAAAAAABAIUCAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wQC4wMA/////wLIF6gEAAAAABYAFLMY1zihXrefAA0DA5nld4MCPjkrAAAAAAAAAAAmaiSqIant4vYcP3HR3v0/qZnfo2lTdVxpBol5mWK0i+vYNpdOjPkAAAAAAQEfyBeoBAAAAAAWABSzGNc4oV63nwANAwOZ5XeDAj45KwEIawJHMEQCIElTV4pbUrsPR9qHWcioowVv3QVWHizxwevfD0u/I8YyAiBCY3OzF81PSLM00h4ueQkehYuxDFZu7Jk51iejphKnnwEhA0VKdYVSyBpWoxBwTDOupB58Fi3mEBs+u+OOqEYVd2sZACICA98YLWyH7dBCfXVxe7woiLSTgV1mJN8Zc8KgZ77pVSg+GNBMeT5UAACAAQAAgAAAAIABAAAAbAAAAAAA",
  "txid": "625b71b314a6ac4f738634e29dc007cd5edc0427c1ae96ab706d06a62910cea2",
  "hex": "02000000000101adaa638f9289eb92a3d89d2f9b6233987d6d6eb1367918a6b748c91d471a7e0b0000000000fdffffff0244760f0400000000160014a4b0f026efb01511cb40080a01bd29b24ed455dd8096980000000000160014e437538b7f13871562066babd1fbab72b4fba9580247304402204953578a5b52bb0f47da8759c8a8a3056fdd05561e2cf1c1ebdf0f4bbf23c6320220426373b317cd4f48b334d21e2e79091e858bb10c566eec9939d627a3a612a79f012103454a758552c81a56a310704c33aea41e7c162de6101b3ebbe38ea84615776b1900000000",
  "complete": true
}
```

Github-Pull: #34561
Rebased-From: 50cf6838e6
2026-02-26 10:00:35 +00:00
MarcoFalke
532afe909e doc: Update Guix install for Debian/Ubuntu
Fixes https://github.com/bitcoin/bitcoin/issues/33982

Co-authored-by: Purple Ninja <129023353+ToRyVand@users.noreply.github.com>

Github-Pull: #34671
Rebased-From: faa70ca764
2026-02-26 09:58:20 +00:00
jayvaliya
5910bd3b5d doc: fix broken bpftrace installation link
The bpftrace project moved from iovisor/bpftrace to bpftrace/bpftraceand
removed the separate INSTALL.md file. Installation instructionsare now
in the README.md Quick Start section.

Github-Pull: #34510
Rebased-From: 42ee31e80c
2026-02-26 09:56:28 +00:00
merge-script
99003bed87 Merge bitcoin/bitcoin#34536: [29.x] Finalise v29.3
c9a7bd90eb doc: Update man pages for v29.3 (sedited)
ea6af54a63 doc: Update release notes for 29.3 (sedited)
824de1e6b3 build: Bump version to 29.3 (sedited)

Pull request description:

  Bump version in build and doc, and regenerate the man pages in preparation for the release of v29.3.

ACKs for top commit:
  fanquake:
    ACK c9a7bd90eb
  willcl-ark:
    ACK c9a7bd90eb

Tree-SHA512: ff05dcb829fb2d9e7a8053cd275415c53148db0b826845a556fff4d3ef04320ef063188c50c5dd24e62142e15763cbabe68ce1cb8eac9d78ccb605ec10519f9a
v29.3
2026-02-09 14:24:44 +00:00
sedited
c9a7bd90eb doc: Update man pages for v29.3 2026-02-09 13:36:20 +01:00
sedited
ea6af54a63 doc: Update release notes for 29.3 2026-02-09 10:16:24 +01:00
sedited
824de1e6b3 build: Bump version to 29.3 2026-02-09 10:14:48 +01:00
merge-script
8de2549bda Merge bitcoin/bitcoin#34450: [29.x] backports + final changes for 29.3rc2
2b2c4daa53 [doc] generate manpages 29.3rc2 (sedited)
75c2108a68 [doc] update release notes for 29.3rc2 (sedited)
16493e35cd Bump version to 29.3rc2 (sedited)
340b58a8ce Add sedited to trusted-keys (sedited)

Pull request description:

  Backport:

  * #34236

  And finalize 29.3rc2.

ACKs for top commit:
  hebasto:
    re-ACK 2b2c4daa53.

Tree-SHA512: 9b145ab19eaa88ad11075b8362d3131ed80578ad46a1be6bfc4687dbcbcd25388b890128b60a54db4b7c1cb9c9d177150c460353e5cac904aac47e0cfde4218e
v29.3rc2
2026-01-30 11:41:32 +00:00
sedited
2b2c4daa53 [doc] generate manpages 29.3rc2 2026-01-30 08:46:42 +01:00
sedited
75c2108a68 [doc] update release notes for 29.3rc2 2026-01-30 08:46:37 +01:00
sedited
16493e35cd Bump version to 29.3rc2 2026-01-29 18:01:16 +01:00
sedited
340b58a8ce Add sedited to trusted-keys
Github-Pull: bitcoin/bitcoin#34236
Rebased-From: d1b227f3ad
2026-01-29 17:58:24 +01:00
merge-script
115172ceb8 Merge bitcoin/bitcoin#34370: [29.x] Fix #34222 backport bugs
65173944ed QA: tool_wallet: Check that db.log is deleted with a lone legacy wallet, but not with a shared db environment (Luke Dashjr)
69a6b9b115 Bugfix: Wallet/Migration: Move backup into wallet directory when migrating from non-directory (Luke Dashjr)
cef01d0be5 Wallet/Migration: Skip moving the backup file back and forth for no reason (Luke Dashjr)
60f529027c Wallet/Migration: If loading the new watchonly or solvables wallet fails, log the correct wallet name in error message (Luke Dashjr)
7475d134f6 Wallet/bdb: Safely and correctly list files only used by the single wallet (Luke Dashjr)

Pull request description:

ACKs for top commit:
  achow101:
    ACK 65173944ed
  furszy:
    light ACK 65173944ed

Tree-SHA512: c10fe00dde512ca78cd6939a748b3875d0b40e9714997aedfd939a1dffdc7eaa2fd1779f3972a34b1c1d9a97d8f1ee1e082c970de15ac0e2ef5d9bbf3dc1d89a
2026-01-29 17:48:10 +01:00
merge-script
74bf92e5f4 Merge bitcoin/bitcoin#34446: [29.x] Backport CI changes
3835e16e5f doc: update release notes for v29.x (fanquake)
6aec0958f1 ci: remove 3rd party js from windows dll gha job (Max Edwards)
c57009eefc chore: Update outdated GitHub Actions versions (Padraic Slattery)

Pull request description:

  Backports:
  * #32513 (partial backport)
  * #34344

ACKs for top commit:
  willcl-ark:
    ACK 3835e16e5f
  sedited:
    ACK 3835e16e5f

Tree-SHA512: e36b00e952fe6edbe931a131dbe66f14d97b2362453fe4a0e7be58697039945832075d486a6634228c4e1a0ab081e2919cf2c76ef2cfc8b2df6f321b6112c284
2026-01-29 16:23:17 +00:00
fanquake
3835e16e5f doc: update release notes for v29.x 2026-01-29 14:31:51 +00:00
Max Edwards
6aec0958f1 ci: remove 3rd party js from windows dll gha job
We can use vswhere.exe directly to create a vs developer
prompt and so can remove this third party dependency.

Co-authored-by: David Gumberg <davidzgumberg@gmail.com>

Github-Pull: #32513
Rebased-From: 7ae0497eef
2026-01-29 14:30:48 +00:00
Padraic Slattery
c57009eefc chore: Update outdated GitHub Actions versions
Github-Pull: #34344
Rebased-From: 9482f00df0
2026-01-29 14:26:28 +00:00
Luke Dashjr
65173944ed QA: tool_wallet: Check that db.log is deleted with a lone legacy wallet, but not with a shared db environment 2026-01-23 13:18:41 +00:00
Luke Dashjr
69a6b9b115 Bugfix: Wallet/Migration: Move backup into wallet directory when migrating from non-directory
While 30.x+ keep backup files in walletdir, 29.x places them in the migrated wallet directory
2026-01-23 13:18:41 +00:00
Luke Dashjr
cef01d0be5 Wallet/Migration: Skip moving the backup file back and forth for no reason
Since we no longer delete the wallet directory, there's no need to vacate it
The moving only served to risk errors by crossing filesystem boundaries (which fs::rename can't handle)
2026-01-23 13:18:41 +00:00
Luke Dashjr
60f529027c Wallet/Migration: If loading the new watchonly or solvables wallet fails, log the correct wallet name in error message 2026-01-23 13:18:41 +00:00
Luke Dashjr
7475d134f6 Wallet/bdb: Safely and correctly list files only used by the single wallet
If any other files exist in the directory, we cannot assume the sharable files are exclusively for this wallet.
But if they are, this also cleans up other log.* files
2026-01-23 13:18:41 +00:00
merge-script
fa91ad3420 Merge bitcoin/bitcoin#34268: [29.x] backports + final changes for 29.3
b834447fb2 [doc] generate manpages 29.3rc1 (glozow)
e9c978391f [build] bump version to 29.3rc1 (glozow)
e973b61dbb [doc] update release notes for 29.3rc1 (glozow)
f4b78c42e5 test: Add a test for anchor outputs in the wallet (Ava Chow)
c6e7765c0a wallet: Throw an error in sendall if the tx size cannot be calculated (Ava Chow)
bab1ac827b wallet: Determine IsFromMe by checking for TXOs of inputs (Ava Chow)
71633a9b5c test: Test wallet 'from me' status change (Ava Chow)
daef5852f0 guix: Fix `osslsigncode` tests (Hennadii Stepanov)
7a71850a6d Remove unreliable seed from chainparams.cpp, and the associated README (SatsAndSports)
2e4688618b miner: fix `addPackageTxs` unsigned integer overflow (ismaelsadeeq)

Pull request description:

  Backports:

  - #34227
  - #33723
  - #33475
  - #33268

  And final changes for 29.3rc1

ACKs for top commit:
  achow101:
    ACK b834447fb2
  janb84:
    ACK b834447fb2
  sedited:
    ACK b834447fb2

Tree-SHA512: 68e02fbde7162f728229f4bfc803bedda6d269e54593ebe40da607f6bd25b2b10bc4297bfa0bc977ce2dc6b558efe6571a7f875090e0f916fc09e5b67432ba30
v29.3rc1
2026-01-15 10:23:09 +00:00
glozow
b834447fb2 [doc] generate manpages 29.3rc1 2026-01-14 10:07:46 -08:00
glozow
e9c978391f [build] bump version to 29.3rc1 2026-01-14 10:07:46 -08:00
glozow
e973b61dbb [doc] update release notes for 29.3rc1 2026-01-14 10:07:46 -08:00
Ava Chow
f4b78c42e5 test: Add a test for anchor outputs in the wallet
Github-Pull: #33268
Rebased-From: 609d265ebc
2026-01-14 10:07:46 -08:00
Ava Chow
c6e7765c0a wallet: Throw an error in sendall if the tx size cannot be calculated
Github-Pull: #33268
Rebased-From: c40dc822d7
2026-01-13 16:40:32 -08:00
Ava Chow
bab1ac827b wallet: Determine IsFromMe by checking for TXOs of inputs
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: #33268
Rebased-From: 39a7dbdd27
2026-01-13 16:40:32 -08:00
Ava Chow
71633a9b5c test: Test wallet 'from me' status change
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: #33268
Rebased-From: e76c2f7a41
2026-01-13 16:40:30 -08:00
Hennadii Stepanov
daef5852f0 guix: Fix osslsigncode tests
Github-Pull: #34227
Rebased-From: 194114daf3
2026-01-12 13:13:49 -08:00
SatsAndSports
7a71850a6d Remove unreliable seed from chainparams.cpp, and the associated README
Github-Pull: #33723
Rebased-From: b0c706795c
2026-01-12 13:13:49 -08:00
ismaelsadeeq
2e4688618b miner: fix addPackageTxs unsigned integer overflow
Github-Pull: #33475
Rebased-From: b807dfcdc5
2026-01-12 13:13:45 -08:00
merge-script
6e7ea3cf2a Merge bitcoin/bitcoin#33788: [29.x] Backport fixes for CVE-2025-46598
6f136cd391 tests: drop expect_disconnect behaviour for tx relay (Anthony Towns)
be0857745a validation: only check input scripts once (Anthony Towns)
65bcbbc538 net_processing: drop MaybePunishNodeForTx (Anthony Towns)
f24291bd96 qa: unit test sighash caching (Antoine Poinsot)
73d3ab8fc9 qa: simple differential fuzzing for sighash with/without caching (Antoine Poinsot)
ddfb9150b8 script: (optimization) introduce sighash midstate caching (Pieter Wuille)
354d46bc10 script: (refactor) prepare for introducing sighash midstate cache (Pieter Wuille)
5a0506eea0 tests: add sighash caching tests to feature_taproot (Pieter Wuille)
020ed613be validation: detect witness stripping without re-running Script checks (Antoine Poinsot)
56626300b8 policy: introduce a helper to detect whether a transaction spends Segwit outputs (Antoine Poinsot)
97088fa75a qa: test witness stripping in p2p_segwit (Antoine Poinsot)

Pull request description:

ACKs for top commit:
  sipa:
    Code review ACK 6f136cd391
  glozow:
    ACK 6f136cd391, looks correct
  darosior:
    ACK 6f136cd391

Tree-SHA512: 445d770ae10bf1c4766810f945a8e5d83bfa0869d346b0f93c237b91101c9af45d6c935414e79ebf5e0c7089599a9a5a96cff82d9703b1d9573ce9deb21971fd
2026-01-12 11:40:55 -08:00
merge-script
3af199531b Merge bitcoin/bitcoin#34222: [29.x] Backport wallets directory deletion fixes
76cdeb7b06 wallet: test: Failed migration cleanup (David Gumberg)
9405e915e7 test: coverage for migration failure when last sync is beyond prune height (furszy)
5e8ad98163 wallet: migration, fix watch-only and solvables wallets names (furszy)
a7e2d106db wallet: improve post-migration logging (furszy)
9ea84c08d7 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure (furszy)
833848e9b8 test: add coverage for unnamed wallet migration failure (furszy)
a074d36254 wallet: fix unnamed wallet migration failure (furszy)
d91f56e1e3 wallet: RestoreWallet failure, erase only what was created (furszy)
cc324aa2be wallettool: do not use fs::remove_all in createfromdump cleanup (Ava Chow)
01c04d32aa wallet: introduce method to return all db created files (furszy)
abaf1e37a7 refactor: remove sqlite dir path back-and-forth conversion (furszy)

Pull request description:

  Backports:
  * #34215
  * #34156
  * #34226
  * 2 required commits from #31423

  Note that this backport is unclean and several changes have to be made to most commits to accommodate BDB and the differences in migration cleanup behavior.

ACKs for top commit:
  furszy:
    Code review ACK 76cdeb7b06
  brunoerg:
    light code review ACK 76cdeb7b06 + backported the functional tests without the fixes and all of them failed accordingly.
  glozow:
    light review ACK 76cdeb7b06.

Tree-SHA512: 432268117783fc9a221d895a6f6601b6a2a5031c76d1443cf804cc1d486b40fcded982409d548acd1c01a13c7b378b840fcc3fbe823d6ba5ffc4ebe017d4e13c
2026-01-12 11:02:04 -08:00
David Gumberg
76cdeb7b06 wallet: test: Failed migration cleanup
Refactor a common way to perform the failed migration test that exists
for default wallets, and add relative-path wallets and absolute-path
wallets.

Github-Pull: 34226
Rebased-From: eeaf28dbe0
2026-01-09 12:56:19 -08:00
furszy
9405e915e7 test: coverage for migration failure when last sync is beyond prune height
Github-Pull: bitcoin/bitcoin#34156
Rebased-From: b7c34d08dd
2026-01-09 12:52:57 -08:00
furszy
5e8ad98163 wallet: migration, fix watch-only and solvables wallets names
Because the default wallet has no name, the watch-only and solvables
wallets created during migration end up having no name either.

This fixes it by applying the same prefix name we use for the backup
file for an unnamed default wallet.

Before: watch-only wallet named "_watchonly"
After:  watch-only wallet named "default_wallet_watchonly"

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: 82caa8193a
2026-01-09 12:52:57 -08:00
furszy
a7e2d106db wallet: improve post-migration logging
Right now, after migration the last message users see is "migration completed",
but the migration isn't actually finished yet. We still need to load the new wallets
to ensure consistency, and if that fails, the migration will be rolled back. This
can be confusing for users.

This change logs the post-migration loading step and if a wallet fails to load and
the migration will be rolled back.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: d70b159c42
2026-01-09 12:52:57 -08:00
furszy
9ea84c08d7 test: restorewallet, coverage for existing dirs, unnamed wallet and prune failure
The first test verifies that restoring into an existing empty directory
or a directory with no .dat db files succeeds, while restoring into a
dir with a .dat file fails.

The second test covers restoring into the default unnamed wallet
(wallet.dat), which also implicitly exercises the recovery path used
after a failed migration.

The third test covers failure during restore on a prune node. When
the wallet last sync was beyond the pruning height.

Github-Pull: bitcoin/bitcoin#34156
Rebased-From: f011e0f068
2026-01-09 12:52:57 -08:00