From aba22e24d7c7e9653d061923943b53dceb986532 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 17 Nov 2016 08:19:52 -0800 Subject: [PATCH] coin: drop getAge. --- lib/primitives/coin.js | 23 +---------------------- lib/primitives/tx.js | 2 +- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/lib/primitives/coin.js b/lib/primitives/coin.js index 97eabdcb..928b32ae 100644 --- a/lib/primitives/coin.js +++ b/lib/primitives/coin.js @@ -109,32 +109,11 @@ Coin.prototype.getConfirmations = function getConfirmations(height) { return 0; if (height < this.height) - return 1; + return 0; return height - this.height + 1; }; -/** - * Calculate coin age. This is slightly different from - * confirmations. If the confirmations are incalculable, - * age is zero. If the age is non-zero, 1 is added to the age. - * @param {Number?} height - Current chain height. Network - * height is used if not passed in. - * @returns {Number} age - */ - -Coin.prototype.getAge = function getAge(height) { - var age = this.getConfirmations(height); - - if (age === -1) - age = 0; - - if (age !== 0) - age += 1; - - return age; -}; - /** * Convert the coin to a more user-friendly object. * @returns {Object} diff --git a/lib/primitives/tx.js b/lib/primitives/tx.js index c4510645..ab84fe44 100644 --- a/lib/primitives/tx.js +++ b/lib/primitives/tx.js @@ -1903,7 +1903,7 @@ TX.prototype.getConfirmations = function getConfirmations(height) { return 0; if (height < this.height) - return 1; + return 0; return height - this.height + 1; };