From f43c2f9aa320ba96b2e88be348c9f90122a65cd8 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Sat, 13 Dec 2014 13:11:03 -0500 Subject: [PATCH] Fixed bug, toObject should use other object's toObject --- lib/block.js | 2 +- lib/transaction/transaction.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/block.js b/lib/block.js index 43e90c8db..6ffa2c1fb 100644 --- a/lib/block.js +++ b/lib/block.js @@ -149,7 +149,7 @@ Block.fromRawBlock = function fromRawBlock(data) { Block.prototype.toObject = function toObject() { var txs = []; this.txs.forEach(function(tx) { - txs.push(tx.toJSON()); + txs.push(tx.toObject()); }); return { magicnum: this.magicnum, diff --git a/lib/transaction/transaction.js b/lib/transaction/transaction.js index 654efe7ba..e6bbe5077 100644 --- a/lib/transaction/transaction.js +++ b/lib/transaction/transaction.js @@ -144,11 +144,11 @@ Transaction.prototype.fromJSON = function(json) { Transaction.prototype.toObject = function toObject() { var inputs = []; this.inputs.forEach(function(input) { - inputs.push(input.toJSON()); + inputs.push(input.toObject()); }); var outputs = []; this.outputs.forEach(function(output) { - outputs.push(output.toJSON()); + outputs.push(output.toObject()); }); return { version: this.version,