Something has changed in the format Bitcoin Core uses for persistence to disk. Either use an old version of Bitcoin Core (0.13?) for creating the files or you will need to investigate into the changes and adapt bitcoinj to it.
On 03/19/2018 10:45 PM, Jameson Lopp wrote: > 20 millibits says that the block parser is choking on a transaction that > spends a SegWit UTXO. > > On Mon, Mar 19, 2018 at 5:38 PM, Olivér Zsámár <[email protected] > <mailto:[email protected]>> wrote: > > Hello! > > I'm new to bitcoinj, and before doing anything, I just want to try > some easy stuff. > I want to read the whole blockchain from Block #1, and doing some > statistics. > > I have this program: > https://pastebin.com/avszTeAK > > It doesn't suppose to do anything. The only thing it should do: just > count all the blocks! > > When I compile my code, I always get this warning: > > mar. 19, 2018 10:00:04 DU org.bitcoinj.core.Context getOrCreate > WARNING: Implicitly creating context. This is a migration step and > this message will eventually go away. > mar. 19, 2018 10:00:04 DU org.bitcoinj.core.Context <init> > INFO: Creating bitcoinj 0.14.6 context. > > After this, it starts counting the blocks. > > But at Block #481815 there is always an exception. > > Block #481814 > Block #481815 > Debugging > java.lang.NegativeArraySizeException > at org.bitcoinj.core.Message.readBytes(Message.java:334) > at > org.bitcoinj.core.TransactionInput.parse(TransactionInput.java:143) > at org.bitcoinj.core.Message.<init>(Message.java:96) > at org.bitcoinj.core.Message.<init>(Message.java:128) > at org.bitcoinj.core.ChildMessage.<init>(ChildMessage.java:57) > at > org.bitcoinj.core.TransactionInput.<init>(TransactionInput.java:133) > at org.bitcoinj.core.Transaction.parse(Transaction.java:564) > at org.bitcoinj.core.Message.<init>(Message.java:96) > at org.bitcoinj.core.Message.<init>(Message.java:128) > at org.bitcoinj.core.ChildMessage.<init>(ChildMessage.java:57) > at org.bitcoinj.core.Transaction.<init>(Transaction.java:232) > at org.bitcoinj.core.Block.parseTransactions(Block.java:242) > at org.bitcoinj.core.Block.parse(Block.java:266) > at org.bitcoinj.core.Message.<init>(Message.java:96) > at org.bitcoinj.core.Message.<init>(Message.java:128) > at org.bitcoinj.core.Block.<init>(Block.java:162) > at > org.bitcoinj.core.BitcoinSerializer.makeBlock(BitcoinSerializer.java:270) > at > org.bitcoinj.core.MessageSerializer.makeBlock(MessageSerializer.java:72) > at > org.bitcoinj.utils.BlockFileLoader.loadNextBlock(BlockFileLoader.java:154) > at > org.bitcoinj.utils.BlockFileLoader.hasNext(BlockFileLoader.java:87) > at com.company.BitcoinReader.read(BitcoinReader.java:33) > at com.company.BitcoinReader.main(BitcoinReader.java:68) > > > First I downloaded the Bitcoin blockchain from here: > https://getbitcoinblockchain.com/ <https://getbitcoinblockchain.com/> > Then I tried to solve my problem after a few failed attempts by > downloading the blockchain using BitcoinCore: > https://bitcoin.org/en/download <https://bitcoin.org/en/download> > Sadly it didn't solve the problem. > > Please help. > :) > > -- > You received this message because you are subscribed to the Google > Groups "bitcoinj" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google > Groups "bitcoinj" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "bitcoinj" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
