From 490d4bc5f15498ae598b5e6a7c769dffb0829ec4 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 2 Feb 2014 20:15:18 -0600 Subject: [PATCH] also check if _orig is empty. without this, place() is never run because isEmpty() does not return true for uninitialize (null) results. --- libethereum/TrieDB.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libethereum/TrieDB.h b/libethereum/TrieDB.h index 2448cf8a9..4df769504 100644 --- a/libethereum/TrieDB.h +++ b/libethereum/TrieDB.h @@ -456,7 +456,7 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli // We will take care to ensure that (our reference to) _orig is killed. // Empty - just insert here - if (_orig.isEmpty()) + if (_orig.isEmpty() || _orig.isNull()) return place(_orig, _k, _v); assert(_orig.isList() && (_orig.itemCount() == 2 || _orig.itemCount() == 17)); @@ -665,7 +665,7 @@ template bytes GenericTrieDB::place(RLP const& _orig, NibbleSlice // ::operator<<(std::cout << "place ", _orig) << ", " << _k << ", " << _s.toString() << std::endl; killNode(_orig); - if (_orig.isEmpty()) + if (_orig.isEmpty() || _orig.isNull()) return RLPStream(2).appendString(hexPrefixEncode(_k, true)).appendString(_s).out(); assert(_orig.isList() && (_orig.itemCount() == 2 || _orig.itemCount() == 17));