Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Setting hardfork on common
Browse files Browse the repository at this point in the history
  • Loading branch information
micahriggan committed Jul 23, 2019
1 parent 0eff24b commit 15228fc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ var Block = module.exports = function (data, opts) {
rawUncleHeaders = data.uncleHeaders || []
}

const height = new BN(this.header.number).toNumber()
const hardfork = this._common.activeHardfork(height)
this._common.setHardfork(hardfork)

// parse uncle headers
for (var i = 0; i < rawUncleHeaders.length; i++) {
this.uncleHeaders.push(new BlockHeader(rawUncleHeaders[i], opts))
}

for (i = 0; i < rawTransactions.length; i++) {
var tx = new Tx(rawTransactions[i], opts)
var tx = new Tx(rawTransactions[i], {common: this._common})
this.transactions.push(tx)
}
}
Expand Down

0 comments on commit 15228fc

Please sign in to comment.