Browse Source

Fixed bug, toObject should use other object's toObject

patch-2
Braydon Fuller 10 years ago
parent
commit
f43c2f9aa3
  1. 2
      lib/block.js
  2. 4
      lib/transaction/transaction.js

2
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,

4
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,

Loading…
Cancel
Save