Hi Philip,

The data file is here (130MB), zipping did not reduce the size much, so I 
put the file 
itself. https://www.dropbox.com/s/0rip4kydc5cn4dm/blk00976.dat?dl=0

Below is a code piece you can try.

regards,
---------------------------------------------------------------------------------------

import org.bitcoinj.core.*;
import org.bitcoinj.params.MainNetParams;
import org.bitcoinj.utils.BlockFileLoader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;


public class ChainParserExperimental {
    private static final Logger log = 
LoggerFactory.getLogger(ChainParserExperimental.class);
    public static void main(String [] args) throws IOException {


        Context.getOrCreate(MainNetParams.get());
        NetworkParameters np = new MainNetParams();

        String blockDir = "D:\\Bitcoin\\blocks\\";
        List<File> list = new LinkedList<File>();
        for (int i = 970; true; i++) {
            File file = new File(blockDir + String.format(Locale.US, 
"blk%05d.dat", i));
            if (!file.exists())
                break;
            //System.out.println(file.getAbsoluteFile().toString());
            list.add(file);
        }
        BlockFileLoader bfl = new BlockFileLoader(np, list);

        while(bfl.hasNext()){
            System.out.println(bfl.next().getTime());
        }
    }
}



----------------------------------------------------------------


On Tuesday, January 2, 2018 at 7:24:54 PM UTC-6, Philip Whitehouse wrote:
>
> Hi Cüneyt, 
>
> Any chance you could send me the blk00976.dat file as an attachment. 
> It's been kind of a pain to try and obtain the right file to reproduce 
> :( 
>
> - Philip Whitehouse 
>
> On 2018-01-02 19:08, Cüneyt wrote: 
> > Hi all, 
> > 
> > Thank You all for developing this project. You have helped a great 
> > many people, especially researchers like me. 
> > 
> > The Bitcoinj 0.14.5 cannot parse blocks starting from blk00976.dat. 
> > As people have noted on the internet, this has something to do with 
> > Segwit.  
> > 
> > A user has opened a question about this on StackOverflow. Please see 
> > it here: 
> > 
> https://bitcoin.stackexchange.com/questions/64081/bitcoinj-fails-with-negativearraysizeexception-when-iteration-over-the-blocks
>  
> > 
> > Do we know if this issue can be solved somehow? I would greatly 
> > appreciate any help. 
> > 
> > Thanks again for the BitcoinJ. 
> > 
> >  -- 
> >  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 bitcoinj+u...@googlegroups.com <javascript:>. 
> >  For more options, visit https://groups.google.com/d/optout [1]. 
> > 
> > 
> > Links: 
> > ------ 
> > [1] 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 bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to