wallet: Handle or explicitly ignore WalletBatch write failures #35998

Open
achow101 wants to merge 10 commits from walletdb-nodiscard into master AGit
achow101 commented 2026-08-17 21:52:38 +00:00 (Migrated from github.com)

A common theme in the wallet is that many database write failures are ignored, when they should probably be handled, or at least documented that a failure is being ignored. This PR marks all database functions in WalletBatch as [[nodiscard]] so that a compiler will tell us if a return value is implicitly ignored. All of the calls to those functions are updated to either deal with failure, or explicitly ignore it with a rationale.

Based on #35752 which handles failures for the encryption functions.

A common theme in the wallet is that many database write failures are ignored, when they should probably be handled, or at least documented that a failure is being ignored. This PR marks all database functions in `WalletBatch` as `[[nodiscard]]` so that a compiler will tell us if a return value is implicitly ignored. All of the calls to those functions are updated to either deal with failure, or explicitly ignore it with a rationale. Based on #35752 which handles failures for the encryption functions.
DrahtBot commented 2026-08-17 21:52:46 +00:00 (Migrated from github.com)

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

External sites

Reviews

See the guideline and AI policy for information on the review process.

Type Reviewers
Concept ACK l0rinc, rkrux, jeanpablojp

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36904 (log: Remove trailing and embedded newlines from log messages by maflcko)
  • #36897 (wallet, migration: Contain all legacy wallet and migration related things in its own subdirectory, namespace, and classes by achow101)
  • #36823 (wallet, migration: Skip legacy wallet records rather than erasing them, and drop unused record erase functions by achow101)
  • #36042 (build: Bump g++ minimum supported version to 13 by maflcko)
  • #36031 (wallet: Remove mapMasterKeys and enforce that only one encryption key can exist by achow101)
  • #35786 (wallet: drop spent parents redundant cache invalidation and notification by furszy)
  • #35444 (wallet: make descriptor SPKM mutex non-recursive by w0xlt)
  • #35302 (Silent Payments: Sending (take 2) by Eunovo)
  • #27865 (wallet: Track no-longer-spendable TXOs separately by achow101)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

LLM Linter (✨ experimental)

Possible typos and grammar issues:

  • src/wallet/export.cpp: Unable to write the a tx record → Unable to write the tx record [the wording is grammatically broken]

2026-11-24 20:36:55

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/35998 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/35998.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/35998#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | Concept ACK | [l0rinc](https://github.com/bitcoin/bitcoin/pull/35998#issuecomment-5320742444), [rkrux](https://github.com/bitcoin/bitcoin/pull/35998#issuecomment-5423370516), [jeanpablojp](https://github.com/bitcoin/bitcoin/pull/35998#pullrequestreview-5111792081) | If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36904](https://github.com/bitcoin/bitcoin/pull/36904) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36904.svg"></sub> (log: Remove trailing and embedded newlines from log messages by maflcko) * [#36897](https://github.com/bitcoin/bitcoin/pull/36897) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36897.svg"></sub> (wallet, migration: Contain all legacy wallet and migration related things in its own subdirectory, namespace, and classes by achow101) * [#36823](https://github.com/bitcoin/bitcoin/pull/36823) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36823.svg"></sub> (wallet, migration: Skip legacy wallet records rather than erasing them, and drop unused record erase functions by achow101) * [#36042](https://github.com/bitcoin/bitcoin/pull/36042) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36042.svg"></sub> (build: Bump g++ minimum supported version to 13 by maflcko) * [#36031](https://github.com/bitcoin/bitcoin/pull/36031) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36031.svg"></sub> (wallet: Remove mapMasterKeys and enforce that only one encryption key can exist by achow101) * [#35786](https://github.com/bitcoin/bitcoin/pull/35786) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35786.svg"></sub> (wallet: drop spent parents redundant cache invalidation and notification by furszy) * [#35444](https://github.com/bitcoin/bitcoin/pull/35444) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35444.svg"></sub> (wallet: make descriptor SPKM mutex non-recursive by w0xlt) * [#35302](https://github.com/bitcoin/bitcoin/pull/35302) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35302.svg"></sub> (Silent Payments: Sending (take 2) by Eunovo) * [#27865](https://github.com/bitcoin/bitcoin/pull/27865) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/27865.svg"></sub> (wallet: Track no-longer-spendable TXOs separately by achow101) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3--> ### LLM Linter (✨ experimental) Possible typos and grammar issues: - `src/wallet/export.cpp`: `Unable to write the a tx record` → `Unable to write the tx record` [the wording is grammatically broken] <sup>2026-11-24 20:36:55</sup>
l0rinc commented 2026-08-17 21:58:12 +00:00 (Migrated from github.com)

Concept ACK, thanks for taking over.
Please see the latest push in https://github.com/bitcoin/bitcoin/pull/35752#issuecomment-5320733236, feel free to adjust it any way you like.

Concept ACK, thanks for taking over. Please see the latest push in https://github.com/bitcoin/bitcoin/pull/35752#issuecomment-5320733236, feel free to adjust it any way you like.
DrahtBot commented 2026-08-18 23:20:46 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
DrahtBot commented 2026-08-26 00:22:09 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task Windows native, fuzz, VS: https://github.com/bitcoin/bitcoin/actions/runs/32908277972/job/97996971269
LLM reason (✨ experimental): CI failed because the fuzz target rpc crashed with exit code 3221225477 (Windows access violation / segfault).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `Windows native, fuzz, VS`: https://github.com/bitcoin/bitcoin/actions/runs/32908277972/job/97996971269</sub> <sub>LLM reason (✨ experimental): CI failed because the fuzz target `rpc` crashed with exit code `3221225477` (Windows access violation / segfault).</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
rkrux commented 2026-08-26 09:33:33 +00:00 (Migrated from github.com)

Concept ACK f8b9da8007ad6468618fc8e4235508a5b7038386 because it enforces the handling of database errors, thereby ensuring consistency between in-memory behaviour and databases behaviour.

Concept ACK f8b9da8007ad6468618fc8e4235508a5b7038386 because it enforces the handling of database errors, thereby ensuring consistency between in-memory behaviour and databases behaviour.
jeanpablojp (Migrated from github.com) reviewed 2026-09-04 10:24:21 +00:00
jeanpablojp (Migrated from github.com) left a comment

Concept ACK

Left some comments.

Concept ACK Left some comments.
jeanpablojp (Migrated from github.com) commented 2026-09-04 10:24:21 +00:00

The throw propagates out of TopUp before TxnCommit, so the cache items roll back while m_max_cached_index and the new range end stay in memory. The retry then derives nothing and WriteDescriptor succeeds, persisting a range wider than the cache behind it. Reopening that wallet stops with Unable to expand wallet descriptor from cache and returns Error loading <file>: Wallet corrupted; before this change, it reopens fine.

It depends on the descriptor. I hit it with wpkh(<xprv>/0h/*h), which needs a cached xpub per index; a plain wpkh(<xprv>/0h/0/*) reopens with no error.

Worth rolling the in-memory side back when the write fails?

The throw propagates out of `TopUp` before `TxnCommit`, so the cache items roll back while `m_max_cached_index` and the new range end stay in memory. The retry then derives nothing and `WriteDescriptor` succeeds, persisting a range wider than the cache behind it. Reopening that wallet stops with `Unable to expand wallet descriptor from cache` and returns `Error loading <file>: Wallet corrupted`; before this change, it reopens fine. It depends on the descriptor. I hit it with `wpkh(<xprv>/0h/*h)`, which needs a cached xpub per index; a plain `wpkh(<xprv>/0h/0/*)` reopens with no error. Worth rolling the in-memory side back when the write fails?
jeanpablojp (Migrated from github.com) commented 2026-09-04 10:24:21 +00:00

All three of these go unnoticed by the suite as it stands, and FaultInjectingDatabase covers each of them with a single injected failure. The TopUpWithDB one also needs a file-backed variant, since the in-memory database dies with the wallet and the effect only shows on reload.

All three of these go unnoticed by the suite as it stands, and `FaultInjectingDatabase` covers each of them with a single injected failure. The `TopUpWithDB` one also needs a file-backed variant, since the in-memory database dies with the wallet and the effect only shows on reload.
Lines 1101-1104
jeanpablojp (Migrated from github.com) commented 2026-09-04 10:24:21 +00:00

The emplace() into mapWallet happens before IncOrderPosNext(), so this return leaves the entry behind with no nOrderPos, no wtxOrdered slot and no AddToSpends, and every later call with the same txid then takes the !fInsertedNew path and reports success without repairing it. With CommitTransaction's update_wtx, the tx record still reaches disk while wtxOrdered stays empty. Before this change, the first call returns the wtx and writes the tx record.

        std::optional<int64_t> pos = IncOrderPosNext(batch);
        if (!pos) {
            mapWallet.erase(hash);
            return nullptr;
        }
The `emplace()` into `mapWallet` happens before `IncOrderPosNext()`, so this return leaves the entry behind with no `nOrderPos`, no `wtxOrdered` slot and no `AddToSpends`, and every later call with the same txid then takes the `!fInsertedNew` path and reports success without repairing it. With `CommitTransaction`'s `update_wtx`, the `tx` record still reaches disk while `wtxOrdered` stays empty. Before this change, the first call returns the wtx and writes the `tx` record. ```suggestion std::optional<int64_t> pos = IncOrderPosNext(batch); if (!pos) { mapWallet.erase(hash); return nullptr; } ```
jeanpablojp (Migrated from github.com) commented 2026-09-04 10:24:21 +00:00

A stale locator only costs a rescan on the next load, but here it cancels the backup before Backup() is reached. With the best block write failing, BackupWallet returns false and no copy is taken; before this change, Backup() still runs. This is the copy you most want when the database starts refusing writes. Would logging and carrying on make sense here?

A stale locator only costs a rescan on the next load, but here it cancels the backup before `Backup()` is reached. With the best block write failing, `BackupWallet` returns false and no copy is taken; before this change, `Backup()` still runs. This is the copy you most want when the database starts refusing writes. Would logging and carrying on make sense here?
jeanpablojp (Migrated from github.com) commented 2026-09-04 10:24:21 +00:00

On a genuinely full disk, with just enough room left for the database to open, this reports Error loading <file>: Wallet corrupted while nothing is corrupt.

            return DBErrors::LOAD_FAIL;

With that swap, loading still fails, but it is reported only as Error loading <file>. I see EraseMasterKey below already returns CORRUPT, so this may well be deliberate.

On a genuinely full disk, with just enough room left for the database to open, this reports `Error loading <file>: Wallet corrupted` while nothing is corrupt. ```suggestion return DBErrors::LOAD_FAIL; ``` With that swap, loading still fails, but it is reported only as `Error loading <file>`. I see `EraseMasterKey` below already returns `CORRUPT`, so this may well be deliberate.
achow101 (Migrated from github.com) reviewed 2026-09-08 20:24:15 +00:00
achow101 (Migrated from github.com) commented 2026-09-08 20:24:15 +00:00

No. If a write fails, it is possible that the database is already corrupted, and we do not want to be making a backup that may not be usable.

No. If a write fails, it is possible that the database is already corrupted, and we do not want to be making a backup that may not be usable.
achow101 (Migrated from github.com) reviewed 2026-09-08 20:27:13 +00:00
Lines 1101-1104
achow101 (Migrated from github.com) commented 2026-09-08 20:27:13 +00:00

This is ok, a failure here results in an exception higher up in the call stack which will result in a crash. Database write failures are supposed to be catastrophic, they are not expected to happen.

This is ok, a failure here results in an exception higher up in the call stack which will result in a crash. Database write failures are supposed to be catastrophic, they are not expected to happen.
achow101 (Migrated from github.com) reviewed 2026-09-08 20:30:33 +00:00
achow101 (Migrated from github.com) commented 2026-09-08 20:30:33 +00:00

The retry

What retry?

Write failures are supposed to be catastrophic and an indicator that corruption has likely happened.

> The retry What retry? Write failures are supposed to be catastrophic and an indicator that corruption has likely happened.
achow101 (Migrated from github.com) reviewed 2026-09-08 20:31:02 +00:00
achow101 (Migrated from github.com) commented 2026-09-08 20:31:02 +00:00

it is not necessary to leave review comments describing what is happening in the code.

it is not necessary to leave review comments describing what is happening in the code.
achow101 (Migrated from github.com) reviewed 2026-09-08 20:32:44 +00:00
achow101 (Migrated from github.com) commented 2026-09-08 20:32:44 +00:00

Failure to write is always corruption, regardless of how that may come about. We don't know why the write failed, it could be for reasons other than a disk being full.

Failure to write is always corruption, regardless of how that may come about. We don't know why the write failed, it could be for reasons other than a disk being full.
DrahtBot commented 2026-09-12 12:01:11 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
DrahtBot commented 2026-09-14 23:37:16 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task iwyu: https://github.com/bitcoin/bitcoin/actions/runs/34902498233/job/104171483904
LLM reason (✨ experimental): IWYU failed because it detected/introduced required #include fixes (e.g., in src/interfaces/wallet.h), causing the CI step to exit non-zero.

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `iwyu`: https://github.com/bitcoin/bitcoin/actions/runs/34902498233/job/104171483904</sub> <sub>LLM reason (✨ experimental): IWYU failed because it detected/introduced required `#include` fixes (e.g., in `src/interfaces/wallet.h`), causing the CI step to exit non-zero.</sub> <details><summary>Hints</summary> Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example: * Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch. * A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test. * An intermittent issue. Leave a comment here, if you need help tracking down a confusing failure. </details>
DrahtBot commented 2026-09-17 02:29:37 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
First-time contributor

Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments.

🔴 Major · Failed top-ups leave address ownership and descriptor caches out of sync

After a descriptor write fails during range extension, later address requests can return scripts missing from CWallet::IsMine, and hardened-wildcard descriptors can become unloadable after a successful retry.

Location: src/wallet/scriptpubkeyman.cpp:1176 (head).

🔴 Major · Order-position write failure leaves a half-added transaction in mapWallet

An ORDERPOSNEXT write failure now leaves a new transaction in mapWallet without spend or history indexes, and retrying the same transaction does not repair those indexes.

Location: src/wallet/wallet.cpp:1043 (head).

🔴 Major · Failed recursive state writes leave descendants unreachable on retry

After a metadata write failure, abandontransaction now skips descendants and input-cache invalidation, while a retry reports success without completing either.

Location: src/wallet/wallet.cpp:1368 (head).

🟠 Minor · The inactive-coinbase walk can leave descendants unabandoned across reload

During a deep reorg, failure of the coinbase's redundant metadata write can skip descendant abandonment, leaving their other wallet inputs reserved even after reload.

Location: src/wallet/wallet.cpp:1082 (head).

🟠 Minor · Checkpoint write failure blocks otherwise viable wallet backups

backupwallet now refuses to copy a readable wallet when its checkpoint update fails, although an older locator can be recovered by rescanning if the required blocks are available.

Location: src/wallet/wallet.cpp:3122 (head).

🔵 Suggestion · The new export error is malformed and omits the transaction ID

The translatable WriteFullTx error says “Unable to write the a tx record” and does not identify which transaction failed.

Location: src/wallet/export.cpp:171 (head).


Reviewed: c145c2ca757e · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:806938d40e279b6d701b2e78128bb1a09b55193a0b697245a1dce6241d3081c1:3329223fb40bbbe44124b0523f0fa08f23650d06836368f60e45a38d2db02971 --> <!-- ralph-base:74f3ed9021e853aa14a402ed0ceef78544c5b4a7 --> <!-- ralph-head:c145c2ca757eef2d79793084859cb9a88351a49d --> <!-- ralph-case:0b70f3f1b18a50dd06f9be3cb00409bece42512af18843b0c959f5a05b36e8e3 --> Earlier concerns neither republished nor resolved: 1 suggestion. See the Run archive linked from the Review report for their assessments. **🔴 Major · Failed top-ups leave address ownership and descriptor caches out of sync** After a descriptor write fails during range extension, later address requests can return scripts missing from `CWallet::IsMine`, and hardened-wildcard descriptors can become unloadable after a successful retry. Location: [`src/wallet/scriptpubkeyman.cpp:1176`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/scriptpubkeyman.cpp#L1176>) (head). **🔴 Major · Order-position write failure leaves a half-added transaction in `mapWallet`** An `ORDERPOSNEXT` write failure now leaves a new transaction in `mapWallet` without spend or history indexes, and retrying the same transaction does not repair those indexes. Location: [`src/wallet/wallet.cpp:1043`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/wallet.cpp#L1043>) (head). **🔴 Major · Failed recursive state writes leave descendants unreachable on retry** After a metadata write failure, `abandontransaction` now skips descendants and input-cache invalidation, while a retry reports success without completing either. Location: [`src/wallet/wallet.cpp:1368`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/wallet.cpp#L1368>) (head). **🟠 Minor · The inactive-coinbase walk can leave descendants unabandoned across reload** During a deep reorg, failure of the coinbase's redundant metadata write can skip descendant abandonment, leaving their other wallet inputs reserved even after reload. Location: [`src/wallet/wallet.cpp:1082`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/wallet.cpp#L1082>) (head). **🟠 Minor · Checkpoint write failure blocks otherwise viable wallet backups** `backupwallet` now refuses to copy a readable wallet when its checkpoint update fails, although an older locator can be recovered by rescanning if the required blocks are available. Location: [`src/wallet/wallet.cpp:3122`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/wallet.cpp#L3122>) (head). **🔵 Suggestion · The new export error is malformed and omits the transaction ID** The translatable `WriteFullTx` error says “Unable to write the a tx record” and does not identify which transaction failed. Location: [`src/wallet/export.cpp:171`](<https://git.fish.foo/bitcoin/bitcoin/src/commit/c145c2ca757eef2d79793084859cb9a88351a49d/src/wallet/export.cpp#L171>) (head). <!-- Review tier: sensitive --> --- Reviewed: [`c145c2ca757e`](<https://git.fish.foo/bitcoin/bitcoin/commit/c145c2ca757eef2d79793084859cb9a88351a49d>) · [Review report](<https://review.fish.foo/report/35998-c145c2ca757eef2d79793084859cb9a88351a49d-3081-3.html>) · [Previous reports](<https://review.fish.foo/traces/35998/>) [permalink](<https://review.fish.foo/report/35998-c145c2ca757eef2d79793084859cb9a88351a49d-3081-3.html>)
DrahtBot commented 2026-10-05 10:14:55 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
vicjuma (Migrated from github.com) reviewed 2026-10-06 19:58:50 +00:00
vicjuma (Migrated from github.com) commented 2026-10-06 19:58:38 +00:00

Makes a lot of sense to work with the all-or-nothing logic here. A purpose or name failure (less tragic) means that the more tragic ones (WriteAddressReceiveRequest and WriteAddressPreviouslySpent may also fail.

Makes a lot of sense to work with the `all-or-nothing` logic here. A purpose or name failure (less tragic) means that the more tragic ones (`WriteAddressReceiveRequest` and `WriteAddressPreviouslySpent` may also fail.
vicjuma (Migrated from github.com) commented 2026-10-06 19:58:12 +00:00

Frankly, a mild issue like @jeanpablojp's disk full/permissions read-write restrictions reporting BErrors::CORRUPT may misguide the user giving then unnecessary tensions. For the others, this may fly, for loading the database IMHO, a log might probably help instead of locking them out with the error ...Wallet corrupted

Frankly, a mild issue like @jeanpablojp's disk full/permissions read-write restrictions reporting `BErrors::CORRUPT` may misguide the user giving then unnecessary tensions. For the others, this may fly, for loading the database IMHO, a log might probably help instead of locking them out with the error `...Wallet corrupted`
DrahtBot commented 2026-11-24 17:08:24 +00:00 (Migrated from github.com)

🐙 This pull request conflicts with the target branch and needs rebase.

<!--cf906140f33d8803c4a75a2196329ecb--> 🐙 This pull request conflicts with the target branch and [needs rebase](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#rebasing-changes).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!35998
No description provided.