Skip to content

Commit

Permalink
Merge pull request #81 from matiu/bug/rounding-errors2
Browse files Browse the repository at this point in the history
fix valOut
  • Loading branch information
matiu committed May 17, 2014
2 parents 8da8724 + 7b7d086 commit 0e5893f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Rpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ Rpc._parseTxResult = function(info) {
var valueOutSat = 0;
info.vout.forEach( function(o) {
o.value = o.value.toFixed(8);
valueOutSat += (o.value * bitcore.util.COIN).toFixed(0);
valueOutSat += o.value * bitcore.util.COIN;
delete o.scriptPubKey.hex;
});
info.valueOut = valueOutSat / bitcore.util.COIN;
info.valueOut = valueOutSat.toFixed(0) / bitcore.util.COIN;
info.size = b.length;

return info;
Expand Down

0 comments on commit 0e5893f

Please sign in to comment.