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 } }); }