From c699864c85664056db0ae2b347130e959966ea3e Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Thu, 8 Aug 2019 11:51:20 -0400 Subject: [PATCH] Fix incorrect snapShot unsharing This fixes #3020. --- src/ripple/shamap/impl/SHAMap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ripple/shamap/impl/SHAMap.cpp b/src/ripple/shamap/impl/SHAMap.cpp index 9d69fe951a..4e5911f4f7 100644 --- a/src/ripple/shamap/impl/SHAMap.cpp +++ b/src/ripple/shamap/impl/SHAMap.cpp @@ -74,7 +74,8 @@ SHAMap::snapShot (bool isMutable) const newMap.root_ = root_; newMap.backed_ = backed_; - if ((state_ != SHAMapState::Immutable) || !isMutable) + if ((state_ != SHAMapState::Immutable) || + (newMap.state_ != SHAMapState::Immutable)) { // If either map may change, they cannot share nodes newMap.unshare ();