原始文献 / 论坛帖 / Re: Incompatible wallet format with latest bitcoin-git ?

Re: Incompatible wallet format with latest bitcoin-git ?

Bitcointalk · 2010-11-30 19:02:31 UTC

AuthorSatoshi Nakamoto
TitleRe: Incompatible wallet format with latest bitcoin-git ?
Date2010-11-30 19:02:31 UTC
ForumBitcointalk · 原文

这个钱包是跟什么一起用的?早期的 accounts 补丁还是 git 构建?

是在加载钱包的时候。我猜肯定在这段里:

else if (strType == "acentry")
{
string strAccount;
ssKey >> strAccount;
uint64 nNumber;
ssKey >> nNumber;
if (nNumber > nAccountingEntryNumber)
nAccountingEntryNumber = nNumber;
}

你可以用这段查一下:

else if (strType == "acentry")
{
string strAccount;
assert(!ssKey.empty());
ssKey >> strAccount;
uint64 nNumber;
if (ssKey.size() != 8 )
printf("***** %s %d\n", strAccount.c_str(), ssKey.size());
assert(ssKey.empty() == false);
ssKey >> nNumber;
if (nNumber > nAccountingEntryNumber)
nAccountingEntryNumber = nNumber;
}

git 上某个时期的 accounts 中间版本是不是有过键只是 ("acentry", "account") 的?

如果你有 gdb,可以在 gdb 里跑,做个 backtrace。

gdb --args bitcoin ...
run
(wait for exception)
bt

英文原文

What was this wallet used with?  An early accounts patch or git build?

It's while loading the wallet.  I assume it must be in this:

else if (strType == "acentry")
    {
        string strAccount;
        ssKey >> strAccount;
        uint64 nNumber;
        ssKey >> nNumber;
        if (nNumber > nAccountingEntryNumber)
            nAccountingEntryNumber = nNumber;
    }

You could check that with this:

else if (strType == "acentry")
    {
        string strAccount;
        assert(!ssKey.empty());
        ssKey >> strAccount;
        uint64 nNumber;
        if (ssKey.size() != 8 )
            printf("***** %s %d
", strAccount.c_str(), ssKey.size());
        assert(ssKey.empty() == false);
        ssKey >> nNumber;
        if (nNumber > nAccountingEntryNumber)
            nAccountingEntryNumber = nNumber;
    }

Was there an interim version of accounts on git at some point that had just ("acentry", "account") for the key?

If you have gdb, you could run it in gdb and do a backtrace.

gdb --args bitcoin ...
run
(wait for exception)
bt