From 931a2a93983147f45f58e083a4755b65f0e8613a Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 10 Dec 2016 23:15:03 -0800 Subject: [PATCH] coins: minor. --- lib/coins/coins.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/coins/coins.js b/lib/coins/coins.js index a1a7ff42..70c19aa9 100644 --- a/lib/coins/coins.js +++ b/lib/coins/coins.js @@ -228,13 +228,11 @@ Coins.prototype.spend = function spend(index) { */ Coins.prototype.remove = function remove(index) { - var entry; + var entry = this.get(index); - if (index >= this.outputs.length) + if (!entry) return false; - entry = this.outputs[index]; - this.outputs[index] = null; this.cleanup();