Preserve damaged empty wallets and durably save private wallet files

This commit is contained in:
archipelago
2026-10-06 15:19:38 -04:00
parent 88d473f6e1
commit 719e723816
2 changed files with 106 additions and 47 deletions
+10
View File
@@ -132,3 +132,13 @@ revenue writes; a load/save outside the operation lock can overwrite another
mutation. Current empty-wallet-file handling, file permissions and directory
fsync require review as part of durable storage. Counter fail-closed tests do
not establish that this larger transaction journal has been implemented.
### Wallet storage durability follow-up
Existing empty/whitespace wallet files now fail closed instead of reporting zero;
only a missing file creates fresh state. Atomic saves use unique0600 temporary
files, file and directory fsync, and cleanup on failure. Concurrency tests prove
whole-file replacement (not read-modify-write serialization), private permissions
and retained targets on rename failure. Wallet tests:57passed. Full backend
qualification passes in `/tmp/archy-wallet-storage-tls-full-tests.log`. No live
wallet was altered. Operation serialization and recovery journal remain open.