From 135949ee19fb3cf8db7e7c41b9416764e2321881 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Fri, 15 May 2015 15:58:47 -0400 Subject: [PATCH] large integers are converted to strings in JSON printing --- src/io/json.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/io/json.cpp b/src/io/json.cpp index 2a116b8..a11cd35 100644 --- a/src/io/json.cpp +++ b/src/io/json.cpp @@ -589,11 +589,23 @@ namespace fc os << "null"; return; case variant::int64_type: - os << v.as_int64(); + { + int64_t i = v.as_int64(); + if( i >> 32 ) + os << v.as_string(); + else + os << i; return; + } case variant::uint64_type: - os << v.as_uint64(); + { + uint64_t i = v.as_uint64(); + if( i >> 32 ) + os << v.as_string(); + else + os << i; return; + } case variant::double_type: os << v.as_double(); return;