Bitcoin Forum
November 10, 2024, 04:01:43 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoinj started barfing on parsing blocks >= 481824  (Read 1610 times)
alphabetacanary (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10


View Profile
August 24, 2017, 05:26:37 PM
 #1

I noticed since block #481824 and onward, my bitcoinj library started throwing this exception when trying to parse blocks:

Exception in thread "main" java.lang.NegativeArraySizeException
        at org.bitcoinj.core.Message.readBytes(Message.java:334)
        at org.bitcoinj.core.TransactionOutput.parse(TransactionOutput.java:163)
        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.TransactionOutput.<init>(TransactionOutput.java:79)
        at org.bitcoinj.core.Transaction.parse(Transaction.java:569)
        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:228)
        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)

I was able to parse blocks before this point no problem.  Anyone have the same problem?
alphabetacanary (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10


View Profile
August 24, 2017, 05:41:21 PM
 #2

....and this is probably due to segwit2x activation @ 481824...doh!
alphabetacanary (OP)
Member
**
Offline Offline

Activity: 75
Merit: 10


View Profile
August 24, 2017, 05:42:50 PM
 #3

...and now I see there is a segwit branch for bitcoinj which I'm sure deals with the issue.  Sorry to bug everyone.  Case closed.
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!