Bitcointalk · I broke my wallet, sends never confirm now.

中本聪,2010 年 9 月 30 日

SN-2844 已核对来源,附原文与上下文。

阅读语言
中文译文

正如你想明白的那样,根本问题在于:交易没有至少 1 个确认之前,我们并不该计数、亦不该花费。0/unconfirmed 交易就是彻头彻尾的二等公民。它们至多是「收到了什么东西」的提示,把它们计入余额或花出去都为时过早。

我做了改动,让它们以浅色显示,金额放在方括号里如 [+1.23],不计入余额、不可用于花费。这并不适用于你发出的交易——你无条件地信任它们,因是你写的。

我并未用 (+1.23),因会计里圆括号表示负数。我希望方括号的区分足够明显,让人明白是什么意思。

JSON-RPC 接口倘若需要,仍能够通过指定 0 个确认看到 0/unconfirmed。

我已把改动上传到 SVN rev 158。我很快会发 0.3.13 RC。

倘若你的钱包里有这类交易,在升级到 0.3.13(很快会来)之前,不要发出任何支付。

倘若你已然发出过这类交易,或者你就是它们的创建者,那么用 theymos 的补丁,或者做下面这个改动,进而用它把你的干净交易发到一个新钱包,清理干净。

把: if (pcoin->GetDepthInMainChain() < 1 && pcoin->GetDebit() <= 0) continue; 改成: if (pcoin->GetDepthInMainChain() < 1) continue;

ORIGINAL · 英文原文
As you figured out, the root problem is we shouldn't be counting or spending transactions until they have at least 1 confirmation.  0/unconfirmed transactions are very much second class citizens.  At most, they are advice that something has been received, but counting them as balance or spending them is premature.

I made changes so they show up in lighter print, with the credit amount in square brackets like [+1.23], and the amount not counted towards your balance and not available for spending.  This doesn't apply to transactions you sent, which you implicitly trust, since you wrote them.

I didn't make it (+1.23) because parenthesis in accounting means negative.  I hope square brackets is different enough to be clear what is meant.

The JSON-RPC interface can still see 0/unconfirmed if it wants by specifying 0 confirmations.

I uploaded the changes to SVN rev 158.  I will post a 0.3.13 RC shortly.

If you have any of these transactions in your wallet, do not send any payments until you've upgraded to 0.3.13, which will be coming soon.

If you've already sent any of these transactions, or you're the creator of them, then use theymos' patch or make the following change and use it to send your clean transactions to a new wallet to clean things up.

change:
    if (pcoin->GetDepthInMainChain() < 1 && pcoin->GetDebit() <= 0)
        continue;
to:
    if (pcoin->GetDepthInMainChain() < 1)
        continue;
来源
Bitcointalk 原始链接 ↗ 记录编号 SN-2844