Repository navigation
gui: Let a mistyped passphrase be typed again - #220
Draft
BenWestgate wants to merge 4 commits into
Draft
BenWestgate wants to merge 4 commits into
BenWestgate wants to merge 4 commits into
Conversation
Bitcoin Core resolves an import timestamp of "now" to its tip's median time. On an offline signer that never synced, that is the genesis block, so every new wallet was born in 2009, and the watch-only copy Bails exports from it asks the online node to rescan from genesis, which a pruned node cannot do. A new wallet now takes this computer's clock, a day early like a recorded creation date, so a clock running up to a day fast cannot skip its first payments. Restores keep the recorded date. On a Core 32.1 regtest signer at genesis, the descriptors were dated 1296688602 (genesis) before and the clock less a day after; the signer still found a payment from blocks it synced later. Claude-Session: https://claude.ai/code/session_01N8jLK61uohaW6W7Y8AHnMb
Every page now asks the window to grow, never past the screen's height, whenever its content is taller than the space it has: on arrival, when a section opens, and when a message gets longer. A window the operator shrinks grows back to fit. The scroller stays as the last resort on a screen too short for the page. Name-and-value rows (wallet identity, wallet record, new card) are one line each, value on the right, so the finished page fits the default 880x620 window and reads straight down against the paper record. The GUI size budget rises by the 13 lines this takes. Claude-Session: https://claude.ai/code/session_01N8jLK9eptxLjUcNnMk1VGr
A wrong wallet passphrase ended on the "Stopped" page, whose buttons both dropped the seed: after a new backup, "Restore my wallet" meant entering every card again. The command line never loses the seed this way. Once cards exist, a failed Bitcoin Core step no longer stops: - A step that changed nothing (a refused passphrase, listing wallets, the fingerprint check) goes back to the page that asked, with the error in a dialog. A worker started by another worker inherits its asker, so this never goes back to a spinner. - A step that may have written (creating or filling a wallet) shows a list of empty wallets fresh from Bitcoin Core, with the error, instead of retrying. The library refuses a wallet that is no longer empty. The unlock page shrinks to one passphrase field and one Unlock button. An unlock done in Bitcoin Core's console is noticed by polling, as the command line waits, replacing the "I unlocked it myself" button. The watch goes on at most once; a typed attempt stops it, and only a refused passphrase starts a new one. `fill` now locks an encrypted wallet again on every way out, including one the operator unlocked in Bitcoin Core whose import fails before the library arms its own relock. A failed relock is still reported. The GUI budget rises from 2,063 to 2,100 lines (2,098 used). Claude-Session: https://claude.ai/code/session_01N8jLK5fxFGLYhRkgPfn86t
BenWestgate
force-pushed
the
claude/project-thread-ys17zs
branch
from
November 17, 2026 20:41
ea568a9 to
24a5fa2
Compare
BenWestgate
force-pushed
the
claude/project-thread-p319g5
branch
from
November 17, 2026 20:54
6bcbfa0 to
dfb6905
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Ben · project thread
Stacked on #217 (head
6bcbfa0, which includes #223). This is one commit.Bug. A wrong wallet passphrase ended on the "Stopped" page. Both of its buttons dropped the seed, so after a new backup, "Restore my wallet" meant typing every card in again. The CLI never asks for the passphrase, so it can't fail this way.
Change (revised after Ben's security review, findings A–E):
_then's newagainargument):_workingrecordspage.asker, and a worker started by another worker inherits it, so this never lands on a spinner (C).wallet_setup.Refusedgoes straight back to the unlock page.work.watchpolls Core off the main loop and moves on at most once, like the CLI's wait. It returnsstop(): any attempt stops it, and only a refused passphrase (the page showing again) starts a new one (D).fill(encrypted=...)locks an encrypted wallet again on every way out, including one the operator unlocked in Core whose import fails before the library arms its own relock (A). A failed relock is still reported (E).BUDGETrises from 2,063 to 2,100 (Ben OK'd this).Checked.
python -m pytest: 668 passed. The bip32-oracle modules are blocked here, so CI covers them.test_gui_watch.py: the polling, driven by a fake GLib loop.test_gui_wallet_setup.py: relock after a Core-unlock early failure, a wallet closed mid-import, andRefused.test_gui_unlock_flow.py: 6 tests on real GTK and libadwaita 1.5 under Xvfb, against a fake bitcoin-cli. They cover a typo then retry, an unlock in Core, a failed import with no retry, a typed unlock racing an unlock in Core, a failed relock, and a chained worker failing. The old head fails 5 of these scenarios.xvfb-run -a python -m pytest tests/test_gui_unlock_flow.py.VM smoke steps are in
/mnt/project-files/pr220/vm-smoke.mdin the project files. It still needs Ben's VM pass and security sign-off.🤖 Generated with Claude Code
https://claude.ai/code/session_01N8jLK5fxFGLYhRkgPfn86t