ethereumjs/ethereumjs-blockchain

blockchain.putGenesis seems not work

poria-cat opened this issue · 1 comments

when I use these code, it can't run and return crash:

var blockchain = new Blockchain(blockchainDB)
var genesisBlock
genesisBlock = new Block()
genesisBlock.header = new BlockHeader(testData.genesisBlockHeader)
blockchain.putGenesis(genesisBlock, function(){})

the crash log:

      self.meta.rawHead = blockHashHexString
                        ^

TypeError: Cannot set property 'rawHead' of null
    at rebuildInfo (/home/elven/Learn/ethereumjs-blockchain/index.js:257:25)
    at /home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:3853:24
    at replenish (/home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:946:17)
    at iterateeCallback (/home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:931:17)
    at /home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:906:16
    at /home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:3858:13
    at lookupParentBlock (/home/elven/Learn/ethereumjs-blockchain/index.js:202:27)
    at /home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:3853:24
    at replenish (/home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:946:17)
    at iterateeCallback (/home/elven/Learn/ethereumjs-blockchain/node_modules/async/dist/async.js:931:17)

Should be fixed now with the latest PR merge on master branch.