diff options
| author | Bitflash <admin@bitflash.network> | 2026-08-07 18:40:19 -0300 |
|---|---|---|
| committer | Bitflash <admin@bitflash.network> | 2026-08-07 18:40:19 -0300 |
| commit | 534cdc2675378a1213b4999fbd6b03f6f0b6ffbc (patch) | |
| tree | c607f9b16e3d5bd455c410437180e605f6137b97 /src/util.cpp | |
| parent | b1eb8b66b8d7b47c7fb2e85d5d4db86a11823366 (diff) | |
shutdown: flush wallet.dat on Windows headless stop
The headless loop installed SIGINT/SIGTERM handlers only under #ifndef _WIN32,
so a headless node on Windows never reached the clean StopNode()+DBFlush() path:
Ctrl-C, closing the console window, a service stop and OS shutdown all killed it
mid-write, and a Berkeley DB wallet.dat left unflushed will not reopen.
Install a SetConsoleCtrlHandler that mirrors the POSIX path: set fShutdown and,
because the OS terminates us shortly after the handler returns on
CLOSE/LOGOFF/SHUTDOWN, block until the main loop signals the flush is done.
A 'taskkill /F' is still an uncatchable hard kill by design.
Closes #16.
Diffstat (limited to 'src/util.cpp')
0 files changed, 0 insertions, 0 deletions