novitski / bitcoinj

Automatically exported from code.google.com/p/bitcoinj
Apache License 2.0
0 stars 0 forks source link

OSX DiskBlockStore problem #396

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello when i tried to run bitcoinj api 
DiskBlockStore first download and first time runs okay.
But when i restart server , i got error as shown below:

NFO: Reading block store from /Users/kadirbasol/gpuminer/kadir.spvchain
Apr 22, 2013 9:52:15 PM com.google.bitcoin.store.DiskBlockStore load
INFO: Read chain head from disk: 
000000000000010ff62557eb4d4a865fc6781250d83d2176a8c3f76aabfc1cf5
com.google.bitcoin.store.BlockStoreException: Could not connect 
9e80fb43d3c5a98b774d96b9b2d9ac0026f784d73c2907bc59fe1d9401fb3c14 to 
000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb604800
    at com.google.bitcoin.store.DiskBlockStore.load(DiskBlockStore.java:151)
    at com.google.bitcoin.store.DiskBlockStore.<init>(DiskBlockStore.java:66)
    at BitcoinClient.<init>(BitcoinClient.java:81)
    at BitcoinClient.init(BitcoinClient.java:41)
    at PaymentReporterClient$1.run(PaymentReporterClient.java:49)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)

I fix it by deleting downloaded blockchain and restart bitcoinj app.
But this is too ugly everytime downloading blockchain not good idea...

Original issue reported on code.google.com by kadir.ba...@gmail.com on 22 Apr 2013 at 6:58

GoogleCodeExporter commented 9 years ago
I didn't try DiskBlockStore for a long time, perhaps I should remove it. Let's 
get you up and running with SPVBlockStore.

Original comment by hearn@google.com on 23 Apr 2013 at 9:26

GoogleCodeExporter commented 9 years ago
Hello , i've tried SPVBlockStore , but this time i got this exception thrown 
when i change it
http://pastie.org/7707242

Original comment by kadir.ba...@gmail.com on 24 Apr 2013 at 6:25

GoogleCodeExporter commented 9 years ago
com.google.bitcoin.store.BlockStoreException: 
com.google.bitcoin.store.BlockStoreException: File size on disk does not match 
expected size: 18848962 vs 641024
    at com.google.bitcoin.store.SPVBlockStore.<init>(SPVBlockStore.java:139)
    at BitcoinClient.<init>(BitcoinClient.java:88)
    at BitcoinClient.init(BitcoinClient.java:46)
    at PaymentReporterClient$1.run(PaymentReporterClient.java:60)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:722)
Caused by: com.google.bitcoin.store.BlockStoreException: File size on disk does 
not match expected size: 18848962 vs 641024
    at com.google.bitcoin.store.SPVBlockStore.<init>(SPVBlockStore.java:107)
    ... 6 more

Original comment by kadir.ba...@gmail.com on 24 Apr 2013 at 6:28

GoogleCodeExporter commented 9 years ago
Did you erase the file first? It uses a different file format to 
BoundedOverheadBlockStore.

Original comment by hearn@google.com on 24 Apr 2013 at 7:50

GoogleCodeExporter commented 9 years ago
doesnt matter.It always such error even delete file.

Original comment by kadir.ba...@gmail.com on 24 Apr 2013 at 7:56

GoogleCodeExporter commented 9 years ago
sorry , seems like problem fixed.
The problem because file was DiskBlockStore format.
But you can delete inside code and remake better maybe if broken?

Original comment by kadir.ba...@gmail.com on 24 Apr 2013 at 8:01

GoogleCodeExporter commented 9 years ago
Maybe we can add some more robustness around file format types, but deleting 
and rebuilding requires co-ordination with the wallet currently. It's up to the 
app. That's why it's an exception.

Original comment by hearn@google.com on 24 Apr 2013 at 8:06