aboutsummaryrefslogtreecommitdiff
path: root/src/univalue
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@bitpay.com>2014-08-20 11:13:52 -0400
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-06-04 09:16:05 +0200
commit5e3060c0d104c734e7e2a200e2d937ea01166c8a (patch)
tree8b5c1e254a751dd93bfcc71efa39ea3173508822 /src/univalue
parentefc78837728bebcf2030d1d495018e563eb10c71 (diff)
downloadbitcoin-5e3060c0d104c734e7e2a200e2d937ea01166c8a.tar.xz
UniValue: export NullUniValue global constant
Diffstat (limited to 'src/univalue')
-rw-r--r--src/univalue/univalue.cpp10
-rw-r--r--src/univalue/univalue.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/univalue/univalue.cpp b/src/univalue/univalue.cpp
index 4e445a542a..6870ce59eb 100644
--- a/src/univalue/univalue.cpp
+++ b/src/univalue/univalue.cpp
@@ -9,7 +9,7 @@
using namespace std;
-static const UniValue nullValue;
+const UniValue NullUniValue;
void UniValue::clear()
{
@@ -175,11 +175,11 @@ bool UniValue::checkObject(const std::map<std::string,UniValue::VType>& t)
const UniValue& UniValue::operator[](const std::string& key) const
{
if (typ != VOBJ)
- return nullValue;
+ return NullUniValue;
int index = findKey(key);
if (index < 0)
- return nullValue;
+ return NullUniValue;
return values[index];
}
@@ -187,9 +187,9 @@ const UniValue& UniValue::operator[](const std::string& key) const
const UniValue& UniValue::operator[](unsigned int index) const
{
if (typ != VOBJ && typ != VARR)
- return nullValue;
+ return NullUniValue;
if (index >= values.size())
- return nullValue;
+ return NullUniValue;
return values[index];
}
diff --git a/src/univalue/univalue.h b/src/univalue/univalue.h
index d31c596a61..afe751ed9d 100644
--- a/src/univalue/univalue.h
+++ b/src/univalue/univalue.h
@@ -152,4 +152,6 @@ extern enum jtokentype getJsonToken(std::string& tokenVal,
unsigned int& consumed, const char *raw);
extern const char *uvTypeName(UniValue::VType t);
+extern const UniValue NullUniValue;
#endif // BITCOIN_UNIVALUE_UNIVALUE_H
+