Bitcoin Forum
November 07, 2024, 01:17:16 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Does Pruning alter the wallet.dat  (Read 1054 times)
Bergmann_Christoph (OP)
Sr. Member
****
Offline Offline

Activity: 409
Merit: 286


View Profile WWW
March 09, 2016, 08:25:12 AM
 #1

Hei,

I recently tried to prune my blockchain - it worked great! - but after it, when I switched back to full blockchain, I run into some problems.

One of several possible explanations could be that pruning alters the wallet.dat.

Does anybody know more?

--
Mein Buch: Bitcoin-Buch.org
Bester Bitcoin-Marktplatz in der Eurozone: Bitcoin.de
Bestes Bitcoin-Blog im deutschsprachigen Raum: bitcoinblog.de

Tips dafür, dass ich den Blocksize-Thread mit Niveau und Unterhaltung fülle und Fehlinformationen bekämpfe:
Bitcoin: 1BesenPtt5g9YQYLqYZrGcsT3YxvDfH239
Ethereum: XE14EB5SRHKPBQD7L3JLRXJSZEII55P1E8C
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
March 09, 2016, 11:04:34 AM
 #2

Hei,

I recently tried to prune my blockchain - it worked great! - but after it, when I switched back to full blockchain, I run into some problems.

One of several possible explanations could be that pruning alters the wallet.dat.

Does anybody know more?

Which problems? AFAIK the only "problem" that is expected is that you have to redownload the blockchain.

Im not really here, its just your imagination.
Bergmann_Christoph (OP)
Sr. Member
****
Offline Offline

Activity: 409
Merit: 286


View Profile WWW
March 14, 2016, 11:24:42 AM
 #3

I thought so, too ... but after all my wallet.dat was rewritten with no keys inside. I don't know why I assume I made some mistake, but just want to ask if someone knew more.

--
Mein Buch: Bitcoin-Buch.org
Bester Bitcoin-Marktplatz in der Eurozone: Bitcoin.de
Bestes Bitcoin-Blog im deutschsprachigen Raum: bitcoinblog.de

Tips dafür, dass ich den Blocksize-Thread mit Niveau und Unterhaltung fülle und Fehlinformationen bekämpfe:
Bitcoin: 1BesenPtt5g9YQYLqYZrGcsT3YxvDfH239
Ethereum: XE14EB5SRHKPBQD7L3JLRXJSZEII55P1E8C
cr1776
Legendary
*
Offline Offline

Activity: 4214
Merit: 1313


View Profile
March 14, 2016, 02:34:56 PM
 #4

I thought so, too ... but after all my wallet.dat was rewritten with no keys inside. I don't know why I assume I made some mistake, but just want to ask if someone knew more.

Hopefully you have a backup (or 2).

If it is something that is reproducible, that could be a bug.  I haven't seen other reports of it though. 

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
March 14, 2016, 08:42:01 PM
 #5

I thought so, too ... but after all my wallet.dat was rewritten with no keys inside. I don't know why I assume I made some mistake, but just want to ask if someone knew more.

Can you post a debug.log or upload it on pastebin if its too large? AFAIK the only part of the code that removes a wallet file is the one that is activated when a corrupted wallet is found. This would show in the log file.

Im not really here, its just your imagination.
Bergmann_Christoph (OP)
Sr. Member
****
Offline Offline

Activity: 409
Merit: 286


View Profile WWW
March 15, 2016, 12:18:05 AM
 #6

sorry, can't post any log. I think I made something wrong, but am not sure.

here are my steps

1. made a copy of my blockchain (directory bc2)
2. prune it. Happy it works
3. copy bc2 to datadir bc1
4. start my client
5. it didn't work: abort after / while loading index
6. redirecting it to bc2
7. it didn't work
8. redirecting it to ./bitcoin (just for a test)
9. it didn't work
10. loading different .conf, to test if .conf is activated and if I find the directory
...
11.-15. at some time the error-notice vanished and it loaded blockchain from genesis with a brand new wallet.dat with one empty address
16. panic and so on
17. trying every directory, everywhere the same
18. wallet.dat is ~70kb
19. loading my copy: 600 kb
20. realizing my copy is from januar. More panic.
21. spending two days recovering deleted files and crawling them for private keys

My guess is pruning made something with index-files in .bitcoin - while my datadir is somewhere else. Why this disrupted the wallet.dat remains a mystery for me.

--
Mein Buch: Bitcoin-Buch.org
Bester Bitcoin-Marktplatz in der Eurozone: Bitcoin.de
Bestes Bitcoin-Blog im deutschsprachigen Raum: bitcoinblog.de

Tips dafür, dass ich den Blocksize-Thread mit Niveau und Unterhaltung fülle und Fehlinformationen bekämpfe:
Bitcoin: 1BesenPtt5g9YQYLqYZrGcsT3YxvDfH239
Ethereum: XE14EB5SRHKPBQD7L3JLRXJSZEII55P1E8C
watashi-kokoto
Sr. Member
****
Offline Offline

Activity: 687
Merit: 269



View Profile
March 15, 2016, 01:24:41 PM
 #7

1. made a copy of my blockchain (directory bc2)
2. prune it. Happy it works
3. copy bc2 to datadir bc1
4. start my client

When copying/backuping/recovering  the database like this, make sure you have both chainstate/ index/ and the latest (or all) blk00xx.dat rev00xx.dat

In case you fail to do this correctly, bitcoin will throw it away and start synchronizing from start. At this point you should shut it down and make sure again you have all (chainstate/ index/,blk00xx.dat rev00xx.dat) set up correctly


My guess is pruning made something with index-files in .bitcoin - while my datadir is somewhere else. Why this disrupted the wallet.dat remains a mystery for me.

Well wallet for example remembers the longest blockchain. But in general  bitcoin doesn't simply trash wallets like this. It was probalby overwriten by you when you coppied whole .bitcoin folder including the wallet


When playing around with wallets you need to be extra careful and make sure you copy them . moving whole bitcoin folder with wallet in it is a really terrible idea.
watashi-kokoto
Sr. Member
****
Offline Offline

Activity: 687
Merit: 269



View Profile
March 15, 2016, 01:31:35 PM
 #8

Note about pruning: it doesn't alter the wallet, but when you have a wallet backup , the backup can become old and pruned node will not open the wallet because it lacks the full blockchain to verify the funds inside the wallet

Not-pruned nodes can open every wallet even old ones.
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!