原始文献 / 论坛帖 / Re: Privacy versus Safety: handling change
Re: Privacy versus Safety: handling change
Bitcointalk · 2010-07-17 16:27:39 UTC
我们应该在钱包里预先排好一批预制地址,需要新地址时就用。地址不大,多备一些也无妨。这样也能更普遍地覆盖这种情况:有人备份之后,又申请了新地址并收到了一笔大额付款。也许应该用分开的队列,一种地址需求就不会把另一种的备货耗光。
地址会在正常位置创建和存储,但同时也会列在一个单独的"已创建但从未使用"地址列表里。当有人申请地址时,就把从未使用队列最前面的地址发出去,同时再创建一个新地址加到队尾。
区块加载代码里有某种重扫描,是用来修复有人复制 wallet.dat 的情况的。我需要确认这个重扫描能处理这种情况:钱包恢复后,已经收到的区块里收到过的付款被遗忘了,需要重新发现。
英文原文
We should queue up a supply of pre-made addresses in the wallet to use when a new address is needed. They aren't very big, so it wouldn't hurt to have a lot of them. This would more generally cover the case also where someone backs up, then requests a new address and receives a big payment with it. Maybe there should be separate queues so one type of demand on addresses doesn't deplete it for the others.
The addresses would be created and stored in the normal place, but also listed on a separate list of created-but-never-used addresses. When an address is requested, the address at the front of the never-used queue is handed out, and a new address is created and added to the back.
There's some kind of rescan in the block loading code that was made to repair the case where someone copied their wallet.dat. I would need to check that the rescan handles the case of rediscovering received payments in blocks that were already received, but are forgotten because the wallet was restored.
