From c637c01abc6c7e6142fcbcecf6f8f5dbd1bde4e5 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Wed, 11 Jul 2012 18:16:47 -0700 Subject: [PATCH] Mark a FIXME for some cases this code mishandles. (I'll fix it shortly.) --- src/SHAMap.cpp | 7 +++++++ src/SHAMap.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/SHAMap.cpp b/src/SHAMap.cpp index 8ecd4d843..116cc470b 100644 --- a/src/SHAMap.cpp +++ b/src/SHAMap.cpp @@ -46,6 +46,13 @@ SHAMap::SHAMap(uint32 seq) : mSeq(seq), mState(Modifying) mTNByID[*root] = root; } +SHAMap::SHAMap(const uint256& hash) : mSeq(0), mState(Synching) +{ // FIXME: Need to acquire root node + root = boost::make_shared(mSeq, SHAMapNode(0, uint256())); + root->makeInner(); + mTNByID[*root] = root; +} + SHAMap::pointer SHAMap::snapShot(bool isMutable) { // Return a new SHAMap that is an immutable snapshot of this one // Initially nodes are shared, but CoW is forced on both ledgers diff --git a/src/SHAMap.h b/src/SHAMap.h index a2a7ed3e0..cbd101718 100644 --- a/src/SHAMap.h +++ b/src/SHAMap.h @@ -290,6 +290,7 @@ public: // build new map SHAMap(uint32 seq = 0); + SHAMap(const uint256& hash); // Returns a new map that's a snapshot of this one. Force CoW SHAMap::pointer snapShot(bool isMutable);