From 81fc7ca05bd0f8e4b21f0eed6c9d4bb29694fc3b Mon Sep 17 00:00:00 2001 From: dimxy Date: Wed, 23 Jan 2019 11:36:56 +0500 Subject: [PATCH 1/3] set fixed precision for coins for heirinfo --- src/cc/heir.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index 71ec9b040..0ba1d3d33 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -15,6 +15,7 @@ #include "CCHeir.h" #include "heir_validate.h" +#include class CoinHelper; class TokenHelper; @@ -1178,7 +1179,7 @@ UniValue HeirInfo(uint256 fundingtxid) if (tokenid == zeroid) { msg = "funding available in coins"; - stream << (double)inputs / COIN; + stream << std::fixed << std::setprecision(8) << (double)inputs / COIN; } else { msg = "funding available in tokens"; From 5f116e5d131c160f6ab390098f1df60cc9a98950 Mon Sep 17 00:00:00 2001 From: dimxy Date: Wed, 23 Jan 2019 11:38:56 +0500 Subject: [PATCH 2/3] removed incorrect debug logging in IsTokensvout --- src/cc/CCtokens.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cc/CCtokens.cpp b/src/cc/CCtokens.cpp index bdb710afb..d7db32b99 100644 --- a/src/cc/CCtokens.cpp +++ b/src/cc/CCtokens.cpp @@ -404,7 +404,6 @@ int64_t IsTokensvout(bool goDeeper, bool checkPubkeys, struct CCcontract_info *c uint8_t evalCodeInOpret; if (vopretExtra.size() >= 2 /*|| vopretExtra.size() != vopretExtra.begin()[0] <-- shold we check this?*/) { - std::cerr << "IsTokensvout() empty or incorrect contract opret" << std::endl; evalCodeInOpret = vopretExtra.begin()[1]; } else { From defe854383e3b1268157ddf3288e0dd3a9bb5b0b Mon Sep 17 00:00:00 2001 From: dimxy Date: Wed, 23 Jan 2019 11:49:07 +0500 Subject: [PATCH 3/3] set fixed precision for total funds, too --- src/cc/heir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/heir.cpp b/src/cc/heir.cpp index 0ba1d3d33..d00cab795 100644 --- a/src/cc/heir.cpp +++ b/src/cc/heir.cpp @@ -1161,7 +1161,7 @@ UniValue HeirInfo(uint256 fundingtxid) if (tokenid == zeroid) { msg = "funding total in coins"; - stream << (double)total / COIN; + stream << std::fixed << std::setprecision(8) << (double)total / COIN; } else { msg = "funding total in tokens";