BitcoinTalk

Incompatible wallet format with latest bitcoin-git ?

BitcoinTalk
#1
From:
davout
Subject:
Incompatible wallet format with latest bitcoin-git ?
Date:
Hi all,

just built the latest bitcoin-git source, seems like the wallet or database format has changed

************************
EXCEPTION: NSt8ios_base7failureE       
CDataStream::read() : end of data       
bitcoin in AppInit()       

terminate called after throwing an instance of 'std::ios_base::failure'
  what():  CDataStream::read() : end of data

Could it be 84d7c981dc52cc738053 that broke something ?

BitcoinTalk
#2
From:
Gavin Andresen
Subject:
Re: Incompatible wallet format with latest bitcoin-git ?
Date:
I haven't tested my 'master' bitcoin-git branch in a while, I wouldn't be surprised if the new 'accounts' code in the subversion tree broke something.

Which not-in-subversion features are you using?
BitcoinTalk
#3
From:
jgarzik
Subject:
Re: Incompatible wallet format with latest bitcoin-git ?
Date:
Hi all,

just built the latest bitcoin-git source, seems like the wallet or database format has changed

************************
EXCEPTION: NSt8ios_base7failureE       
CDataStream::read() : end of data       
bitcoin in AppInit()       

terminate called after throwing an instance of 'std::ios_base::failure'
  what():  CDataStream::read() : end of data

Could it be 84d7c981dc52cc738053 that broke something ?

What are the lines in debug.log leading up to the end-of-file exception you pasted?
BitcoinTalk
#4
From:
davout
Subject:
Re: Incompatible wallet format with latest bitcoin-git ?
Date:
I have tested accounts, it works very well

BitcoinTalk
#5
From:
davout
Subject:
Re: Incompatible wallet format with latest bitcoin-git ?
Date:
Bitcoin version 3.17.1 beta
Default data directory /home/david/.bitcoin
Bound to port 8333
bitcoin server starting
Loading addresses...
dbenv.open strLogDir=/home/david/.bitcoin/database strErrorFile=/home/david/.bitcoin/db.log
Loaded 5017 addresses
 addresses               122ms
Loading block index...
LoadBlockIndex(): hashBestChain=00000000000013587f18  height=94571
 block index            1294ms
Loading wallet...


************************
EXCEPTION: NSt8ios_base7failureE       
CDataStream::read() : end of data       
bitcoin in AppInit()       

terminate called after throwing an instance of 'std::ios_base::failure'


************************
EXCEPTION: NSt8ios_base7failureE       
CDataStream::read() : end of data       
bitcoin in AppInit()       

  what():  CDataStream::read() : end of data
BitcoinTalk
#6
From:
satoshi
Subject:
Re: Incompatible wallet format with latest bitcoin-git ?
Date:
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