diff --git a/src/SHAMap.cpp b/src/SHAMap.cpp index b199cb7a1e..372bd3f0fe 100644 --- a/src/SHAMap.cpp +++ b/src/SHAMap.cpp @@ -36,7 +36,6 @@ std::stack SHAMap::getStack(const uint256& id, bool inc // produce a stack of nodes along the way, with the terminal node at the top std::stack stack; SHAMapTreeNode::pointer node = root; - while (!node->isLeaf()) { stack.push(node); @@ -495,6 +494,7 @@ bool SHAMap::addGiveItem(SHAMapItem::pointer item, bool isTransaction) { std::cerr << "Node: " << node->getString() << std::endl; std::cerr << "NewNode: " << newNode->getString() << std::endl; + dump(); assert(false); throw SHAMapException(InvalidNode); } @@ -670,6 +670,7 @@ BOOST_AUTO_TEST_SUITE(shamap) BOOST_AUTO_TEST_CASE( SHAMap_test ) { // h3 and h4 differ only in the leaf, same terminal node (level 19) + SHAMapNode::ClassInit(); uint256 h1, h2, h3, h4, h5; h1.SetHex("092891fe4ef6cee585fdc6fda0e09eb4d386363158ec3321b8123e5a772c6ca7"); h2.SetHex("436ccbac3347baa1f1e53baeef1f43334da88f1f6d70d963b833afd6dfa289fe"); diff --git a/src/SHAMap.h b/src/SHAMap.h index cf1afc777d..2a1e536e6e 100644 --- a/src/SHAMap.h +++ b/src/SHAMap.h @@ -339,8 +339,6 @@ public: static std::vector checkTrustedPath(const uint256& ledgerHash, const uint256& leafIndex, const std::list >& path); - static bool TestSHAMap(); - static bool syncTest(); bool deepCompare(SHAMap& other); virtual void dump(bool withHashes = false); }; diff --git a/src/SHAMapSync.cpp b/src/SHAMapSync.cpp index 5821550c5b..4807df2897 100644 --- a/src/SHAMapSync.cpp +++ b/src/SHAMapSync.cpp @@ -366,6 +366,7 @@ BOOST_AUTO_TEST_CASE( SHAMapSync_test ) unsigned int seed; RAND_pseudo_bytes(reinterpret_cast(&seed), sizeof(seed)); srand(seed); + SHAMapNode::ClassInit(); SHAMap source, destination; diff --git a/src/TransactionEngine.cpp b/src/TransactionEngine.cpp index 0d1ac5d171..6ae66d58e2 100644 --- a/src/TransactionEngine.cpp +++ b/src/TransactionEngine.cpp @@ -8,7 +8,7 @@ typedef SerializedLedgerEntry SLE; -#define DIR_NODE_MAX 1 +#define DIR_NODE_MAX 32 // We return the uNodeDir so that on delete we can quickly know where the element is mentioned in the directory. TransactionEngineResult TransactionEngine::dirAdd(