Fixed bug, toObject should use other object's toObject
This commit is contained in:
parent
5477a2d857
commit
f43c2f9aa3
|
@ -149,7 +149,7 @@ Block.fromRawBlock = function fromRawBlock(data) {
|
||||||
Block.prototype.toObject = function toObject() {
|
Block.prototype.toObject = function toObject() {
|
||||||
var txs = [];
|
var txs = [];
|
||||||
this.txs.forEach(function(tx) {
|
this.txs.forEach(function(tx) {
|
||||||
txs.push(tx.toJSON());
|
txs.push(tx.toObject());
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
magicnum: this.magicnum,
|
magicnum: this.magicnum,
|
||||||
|
|
|
@ -144,11 +144,11 @@ Transaction.prototype.fromJSON = function(json) {
|
||||||
Transaction.prototype.toObject = function toObject() {
|
Transaction.prototype.toObject = function toObject() {
|
||||||
var inputs = [];
|
var inputs = [];
|
||||||
this.inputs.forEach(function(input) {
|
this.inputs.forEach(function(input) {
|
||||||
inputs.push(input.toJSON());
|
inputs.push(input.toObject());
|
||||||
});
|
});
|
||||||
var outputs = [];
|
var outputs = [];
|
||||||
this.outputs.forEach(function(output) {
|
this.outputs.forEach(function(output) {
|
||||||
outputs.push(output.toJSON());
|
outputs.push(output.toObject());
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
version: this.version,
|
version: this.version,
|
||||||
|
|
Loading…
Reference in New Issue