From 8b156d246eb63f6b3d99f3c730f5a0f240abeb71 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Fri, 8 Apr 2016 16:33:15 -0700 Subject: [PATCH] fixes. --- bin/bcoin-cli | 5 ++++- lib/bcoin/tx.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/bcoin-cli b/bin/bcoin-cli index d8ceda41..4424e072 100755 --- a/bin/bcoin-cli +++ b/bin/bcoin-cli @@ -122,7 +122,10 @@ function getTX(callback) { function getBlock(callback) { var hash = argv.args[0]; - hash = utils.revHex(hash); + if (utils.isInt(hash)) + hash = +hash; + else + hash = utils.revHex(hash); client.getBlock(hash, function(err, block) { if (err) return callback(err); diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index 6240cfb0..39ec1f30 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -106,8 +106,8 @@ TX.prototype.clone = function clone() { copy.outputs.push({ value: this.outputs[i].value, script: { - code: this.inputs[i].script.code.slice(), - raw: this.inputs[i].script.raw + code: this.outputs[i].script.code.slice(), + raw: this.outputs[i].script.raw } }); }