Skip to content

Commit 0e5893f

Browse files
committed
Merge pull request #81 from matiu/bug/rounding-errors2
fix valOut
2 parents 8da8724 + 7b7d086 commit 0e5893f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Rpc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ Rpc._parseTxResult = function(info) {
3131
var valueOutSat = 0;
3232
info.vout.forEach( function(o) {
3333
o.value = o.value.toFixed(8);
34-
valueOutSat += (o.value * bitcore.util.COIN).toFixed(0);
34+
valueOutSat += o.value * bitcore.util.COIN;
3535
delete o.scriptPubKey.hex;
3636
});
37-
info.valueOut = valueOutSat / bitcore.util.COIN;
37+
info.valueOut = valueOutSat.toFixed(0) / bitcore.util.COIN;
3838
info.size = b.length;
3939

4040
return info;

0 commit comments

Comments
 (0)