Bitcoin Forum
December 14, 2024, 10:45:18 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Incompatible wallet format with latest bitcoin-git ?  (Read 2089 times)
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
November 29, 2010, 08:45:46 PM
 #1

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 ?


Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2311


Chief Scientist


View Profile WWW
November 29, 2010, 08:56:02 PM
 #2

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?

How often do you get the chance to work on a potentially world-changing project?
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
November 29, 2010, 08:58:30 PM
 #3

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?

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
November 29, 2010, 09:07:28 PM
 #4

I have tested accounts, it works very well


davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
November 29, 2010, 09:09:06 PM
 #5

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

satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364
Merit: 7431


View Profile
November 30, 2010, 07:02:31 PM
 #6

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\n", 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
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2311


Chief Scientist


View Profile WWW
November 30, 2010, 07:58:34 PM
 #7

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

I just browsed back through the git commit history, and I don't see any interim commits of the account code (I was working in local branches, and didn't push interim versions up).

davout: You should try dumping your wallet using the latest bitcointools (dbdump.py --wallet), it will tell you if it finds weird key values in there.

How often do you get the chance to work on a potentially world-changing project?
davout (OP)
Legendary
*
Offline Offline

Activity: 1372
Merit: 1008


1davout


View Profile WWW
December 01, 2010, 01:21:05 PM
 #8

As far as i remember i just used an svn checkout patched with m0ms getwork.

I've made a mass save of all my wallets and replaced them by new ones, i just plan on using them against an older version of bitcoins in a couple of months to check if coins arrived to one of them and then send them to my new wallets.

I haven't seen any half-done accounts patch around, just built from git source when gavin announced the functionality on the forum.

Anyway, if I'm the only one impacted it's a non-issue Smiley

Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2311


Chief Scientist


View Profile WWW
December 07, 2010, 02:39:55 PM
 #9

Just to close the loop on this:

This happened when:
  You ran version 0.3.17, and sent/received some coins
  You then ran an earlier version, and the coins you sent/received with 0.3.17 were rewriten to the wallet (e.g. you spent them or they got included in a block).  They'd get rewritten incorrectly (marked as version 0.3.17, but missing extra info).
  ... and then you upgraded to version 0.3.17 again.   Bitcoin would crash trying to read the extra, missing info.

svn r196 fixes the problem, by storing the extra account info in a different way and detecting the badly-written 0.3.17 entries.

How often do you get the chance to work on a potentially world-changing project?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!