回复:隐私与安全:如何处理找零
原始发布页
打开来源页面查看 1 个交叉存档
我们应该在钱包中预先准备一批地址,排队留待需要新地址时使用。它们占不了多少空间,所以多准备一些也无妨。这样也能更普遍地覆盖这种情况:有人做了备份,随后申请一个新地址,并通过它收到一笔大额付款。也许应该设置不同的队列,以免一种地址需求把其他用途的地址耗尽。
这些地址会在通常的位置创建并存储,同时也列入一份已创建但从未使用的地址清单。当有人申请地址时,就发放未使用队列最前面的地址,然后创建一个新地址并添加到队尾。
区块加载代码中有某种重新扫描机制,是为修复有人复制 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.