diff --git a/lib/server.go b/lib/server.go index c63b2013e..8428c1665 100644 --- a/lib/server.go +++ b/lib/server.go @@ -565,7 +565,9 @@ func NewServer( // This can happen if the node was terminated mid-operation last time it was running. The recovery process rolls back // blocks to the beginning of the current snapshot epoch and resets to the state checksum to the epoch checksum. if shouldRestart { - stateChangeSyncer.Reset() + if stateChangeSyncer != nil { + stateChangeSyncer.Reset() + } glog.Errorf(CLog(Red, "NewServer: Forcing a rollback to the last snapshot epoch because node was not closed "+ "properly last time")) if err := _snapshot.ForceResetToLastSnapshot(_chain); err != nil { diff --git a/lib/snapshot.go b/lib/snapshot.go index 35f15f663..1c3f96adb 100644 --- a/lib/snapshot.go +++ b/lib/snapshot.go @@ -462,9 +462,6 @@ func (snap *Snapshot) Run() { snap.SnapshotProcessBlock(operation.blockNode) case SnapshotOperationProcessChunk: - // If operationQueueSemaphore is full, we are already storing too many chunks in memory. Block the thread while - // we wait for the queue to clear up. - snap.operationQueueSemaphore <- struct{}{} glog.V(1).Infof("Snapshot.Run: Number of operations in the operation channel (%v)", snap.OperationChannel.GetStatus()) if err := snap.SetSnapshotChunk(operation.mainDb, operation.mainDbMutex, operation.snapshotChunk,