From 3158f57e0f3b376970b58c67f4cdf0c0869ee50f Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 2 Feb 2016 20:28:35 -0800 Subject: [PATCH] fix tx.render() and avoidFeeSnipping(). --- lib/bcoin/tx.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index 339413bd..9eae20d5 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -103,7 +103,7 @@ TX.prototype.hash = function hash(enc, force) { TX.prototype.render = function render(force) { if (!force && this.network && this._raw) - return this._raw.slice(); + return utils.toArray(this._raw).slice(); return bcoin.protocol.framer.tx(this); }; @@ -1441,10 +1441,10 @@ TX.prototype.avoidFeeSnipping = function avoidFeeSnipping() { if (!this.chain) return; - this.locktime = this.chain.height(); + this.setLocktime(this.chain.height()); if ((Math.random() * 10 | 0) === 0) - this.locktime = Math.max(0, this.locktime - (Math.random() * 100 | 0)); + this.setLocktime(Math.max(0, this.locktime - (Math.random() * 100 | 0))); }; TX.prototype.setLocktime = function setLocktime(locktime) {