Skip to content

Commit

Permalink
fix for using with node <=0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Jan 30, 2016
1 parent 05779ec commit 17fbb5f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/coininfo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var assign = require('object-assign')

// annoyingly, this is for browserify
var coins = [
require('./coins/blk'),
Expand Down Expand Up @@ -55,7 +57,7 @@ coins.forEach(function (coin) {
})

function toBitcoinJS () {
return Object.assign({}, this, {
return assign({}, this, {
messagePrefix: null, // TODO
bip32: {
public: this.versions.bip32.public,
Expand All @@ -71,10 +73,10 @@ function toBitcoinJS () {
function toBitcore () {
// reverse magic
var nm = new Buffer(4)
nm.writeUInt32BE(this.protocol ? this.protocol.magic : 0)
nm.writeUInt32BE(this.protocol ? this.protocol.magic : 0, 0)
nm = nm.readUInt32LE(0)

return Object.assign({}, this, {
return assign({}, this, {
name: this.testnet ? 'testnet' : 'livenet',
alias: this.testnet ? 'testnet' : 'mainnet',
pubkeyhash: this.versions.public,
Expand Down

0 comments on commit 17fbb5f

Please sign in to comment.