From 9910fa4d4079a541c53666cf1549b1349f771edc Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Mon, 10 Feb 2014 15:49:33 -0300 Subject: [PATCH] fix rounding errs at valueOut --- lib/TransactionRpc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/TransactionRpc.js b/lib/TransactionRpc.js index 0eaef276..01f4679e 100644 --- a/lib/TransactionRpc.js +++ b/lib/TransactionRpc.js @@ -32,11 +32,11 @@ function spec(b) { }); // Outputs - var valueOut = 0; + var valueOutSat = 0; info.vout.forEach( function(o) { - valueOut += o.value; + valueOutSat += o.value * util.COIN; }); - info.valueOut = valueOut; + info.valueOut = parseInt(valueOutSat) / util.COIN; info.size = b.length; return info;