diff --git a/src/SHAMap.cpp b/src/SHAMap.cpp index 8ecd4d843d..116cc470bf 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 a2a7ed3e0a..cbd1017180 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);