diff --git a/src/ripple/app/ledger/impl/LedgerMaster.cpp b/src/ripple/app/ledger/impl/LedgerMaster.cpp index 025741ac69..3f6ebc1e58 100644 --- a/src/ripple/app/ledger/impl/LedgerMaster.cpp +++ b/src/ripple/app/ledger/impl/LedgerMaster.cpp @@ -413,9 +413,8 @@ public: } if (didApply) { - ledger->setImmutable (); // So the next line doesn't have to copy - mCurrentLedger.set (ledger); - getApp().getOPs ().pubProposedTransaction (ledger, txn, result); + mCurrentLedger.set (ledger); + getApp().getOPs ().pubProposedTransaction (ledger, txn, result); } return result; } diff --git a/src/ripple/app/main/Application.cpp b/src/ripple/app/main/Application.cpp index f5d2119b80..5066bfeb05 100644 --- a/src/ripple/app/main/Application.cpp +++ b/src/ripple/app/main/Application.cpp @@ -1068,7 +1068,6 @@ void ApplicationImp::startNewLedger () firstLedger->updateHash (); firstLedger->setClosed (); firstLedger->setAccepted (); - firstLedger->setImmutable(); m_ledgerMaster->pushLedger (firstLedger); Ledger::pointer secondLedger = std::make_shared (true, std::ref (*firstLedger)); diff --git a/src/ripple/shamap/SHAMap.h b/src/ripple/shamap/SHAMap.h index 5090bf970a..dd7e26e39d 100644 --- a/src/ripple/shamap/SHAMap.h +++ b/src/ripple/shamap/SHAMap.h @@ -278,7 +278,6 @@ void SHAMap::setImmutable () { assert (state_ != SHAMapState::Invalid); - unshare (); state_ = SHAMapState::Immutable; } diff --git a/src/ripple/shamap/impl/SHAMap.cpp b/src/ripple/shamap/impl/SHAMap.cpp index 962ae1207d..e043e56622 100644 --- a/src/ripple/shamap/impl/SHAMap.cpp +++ b/src/ripple/shamap/impl/SHAMap.cpp @@ -75,7 +75,7 @@ SHAMap::snapShot (bool isMutable) const newMap.seq_ = seq_ + 1; newMap.root_ = root_; - if ((state_ != SHAMapState::Immutable) || isMutable) + if ((state_ != SHAMapState::Immutable) || !isMutable) { // If either map may change, they cannot share nodes newMap.unshare ();