aboutsummaryrefslogtreecommitdiff
path: root/src/univalue/univalue.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-07-18 07:44:19 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-07-18 09:04:18 +0200
commit7650449a6777710cf818d41862626164da0cd412 (patch)
treeddb32fd03bd9df82961ea176810b50faba133a23 /src/univalue/univalue.h
parente061e2778d592826970483e0844308c4e9a12626 (diff)
downloadbitcoin-7650449a6777710cf818d41862626164da0cd412.tar.xz
univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code doesn't need to do so either. This removes VREAL, as well as its specific post-processing in `UniValue::write`. Non-monetary amounts do not need to be forcibly formatted with 8 decimals, so the extra roundtrip was unnecessary (and potentially loses precision).
Diffstat (limited to 'src/univalue/univalue.h')
-rw-r--r--src/univalue/univalue.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/univalue/univalue.h b/src/univalue/univalue.h
index 54239741e2..4742b56f3d 100644
--- a/src/univalue/univalue.h
+++ b/src/univalue/univalue.h
@@ -16,7 +16,7 @@
class UniValue {
public:
- enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VREAL, VBOOL, };
+ enum VType { VNULL, VOBJ, VARR, VSTR, VNUM, VBOOL, };
UniValue() { typ = VNULL; }
UniValue(UniValue::VType initialType, const std::string& initialStr = "") {
@@ -78,7 +78,6 @@ public:
bool isBool() const { return (typ == VBOOL); }
bool isStr() const { return (typ == VSTR); }
bool isNum() const { return (typ == VNUM); }
- bool isReal() const { return (typ == VREAL); }
bool isArray() const { return (typ == VARR); }
bool isObject() const { return (typ == VOBJ); }