Merge pull request #81 from matiu/bug/rounding-errors2

fix valOut
This commit is contained in:
Matias Alejo Garcia 2014-05-17 18:49:43 -03:00
commit 0e5893fbad
1 changed files with 2 additions and 2 deletions

View File

@ -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;