原始文献 / 论坛帖 / Re: I broke my wallet, sends never confirm now.

Re: I broke my wallet, sends never confirm now.

Bitcointalk · 2010-09-30 16:38:53 UTC

AuthorSatoshi Nakamoto
TitleRe: I broke my wallet, sends never confirm now.
Date2010-09-30 16:38:53 UTC
ForumBitcointalk · 原文

正如你发现的,根本问题是:在交易至少有 1 个确认之前,我们不该计入或花掉它们。0/未确认交易是二等公民。它们顶多算个提示,说收到了点东西,但计入余额或花掉还为时过早。

我改了,让它们以较淡的字体显示,入账金额用方括号像 [+1.23],金额不计入余额、也不能花。这不适用于你发出的交易——那是你自己写的,你当然信任。

我没用 (+1.23),因为会计里括号表示负数。希望方括号足够不同,能表达清楚。

JSON-RPC 接口如果想看 0/未确认,指定 0 个确认就行。

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

如果你的钱包里有这类交易,在升级到 0.3.13 之前不要发任何付款,0.3.13 很快就来。

如果你已经发了这类交易,或者你是它们的创建者,那就用 theymos 的补丁,或做如下修改,用它把干净的交易发到新钱包来清理。

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

英文原文

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;