Okay, at least it works. If you get some other solutions, please let me 
know, thank you.

在 2018年4月3日星期二 UTC+8下午5:54:55,Olivér Zsámár写道:
>
> Hi!
>
> I couldn't solve this using bitcoinj.
> Maybe you could use Blockchain Data Api at blockchain.info for the SegWit 
> blocks.
>
> Its very slow for that and you have to download the segwit blocks by using 
> that api. But at least it works.
>
>
> <[email protected] <javascript:>> ezt írta (időpont: 2018. ápr. 3., K 
> 11:47):
>
>> Hi, do you solve this problem? I get the same one.
>>
>> 在 2018年3月20日星期二 UTC+8上午5:38:14,Olivér Zsámár写道:
>>>
>>> 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/
>>> Then I tried to solve my problem after a few failed attempts by 
>>> downloading the blockchain using BitcoinCore: 
>>> https://bitcoin.org/en/download
>>> Sadly it didn't solve the problem.
>>>
>>> Please help.
>>> :)
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "bitcoinj" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/bitcoinj/fGWBPbTORAg/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> 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.

Reply via email to