Skip to content

中本聪致达斯汀·特拉梅尔:回复:一些想法——钱包位置与套接字修复(2009 年 1 月 16 日) ​

历史档案 / 镜像

打开历史存档
来源说明

Published verbatim by Dustin Trammell in November 2013. Full mbox archive distributed as Satoshi_Nakamoto.zip via Trammell's blog (https://blog.dustintrammell.com/i-am-not-satoshi/).

关于这个话题,我想到的一件事是,如果系统发生故障, 比特币可能会丢失。这个应用程序似乎没有 在它的运行目录中存储任何数据,所以我猜数据是存储在 注册表和其他地方(还没有拿出 ProcessExplorer 自己检查),因此最好能让应用程序 把恢复所需的一切导出到一个文件中, 以便备份到该系统之外。

这些文件位于 "%appdata%\Bitcoin",这就是需要 备份的目录。数据存储在事务型 DBM 数据库中,因此 即使发生崩溃或断电,应该也不会丢失。

%appdata% 采用按用户划分的访问权限。大多数新程序,例如 Firefox,都会把设置文件存放在那里,尽管存在这些阻力: Microsoft 每发布一个 Windows 版本就更改一次目录名称, 而且目录名中满是空格,又长得会超出屏幕。

我今天注意到的另一件事是,如果关闭应用程序,它似乎 不会干净地关闭网络套接字(TCP RST 开始 满天飞)。这大概可以列入低优先级待办事项清单 (:

刚刚已经为下一个版本添加了处理这个问题的代码。

中本聪

英文原文 ​

展开英文原文

One thing that came to mind on this topic is the potential for BitCoin loss if you have a system failure. The application doesn't seem to store any data in the directory that it runs in, so I assume it's stored in the registry and other places (haven't cracked out ProcessExplorer yet to check myself), so it may be a good idea to have the application be able to export everything that it needs for recovery to a file that could be backed up off of the system.

The files are in "%appdata%\Bitcoin", that's the directory to backup. The data is stored in a transactional database DBM, so it should be safe from loss if there's a crash or power failure.

%appdata% is per-user access privilege. Most new programs like Firefox store their settings files there, despite the headwind of Microsoft changing the directory name with every Windows release and being full of spaces and so long it runs off the screen.

One other thing I noticed today is that if you close the application it doesn't appear to cleanly close it's network sockets (TCP RST's start flying). Probably an item for the low-priority todo list (:

Just now added code to the next release for that.

Satoshi

为历史保存,为中文读者整理。每篇档案均附来源与英文原文。