From 265270260aea6104d8b17a9c33dfca045e193f7c Mon Sep 17 00:00:00 2001 From: Lazy Nina Date: Wed, 12 Jun 2024 14:50:22 -0400 Subject: [PATCH] Save snapshot status --- lib/snapshot.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/snapshot.go b/lib/snapshot.go index 6961f7ffd..7112b9847 100644 --- a/lib/snapshot.go +++ b/lib/snapshot.go @@ -997,6 +997,7 @@ func (snap *Snapshot) snapshotProcessBlockNoLock(blockNode *BlockNode) { height := uint64(blockNode.Height) if height > snap.Status.CurrentBlockHeight { snap.Status.CurrentBlockHeight = height + snap.Status.SaveStatus() // If we haven't hit the first snapshot block height yet, don't bother. if !snap.shouldPerformSnapshotOperations() { return @@ -1569,8 +1570,8 @@ func (sc *StateChecksum) AddOrRemoveBytesWithMigrations(keyInput []byte, valueIn // We add the current key, value encoding and encodings for all migrations. encodings = append(encodings, EncodeKeyAndValueForChecksum(key, value, blockHeight)) - checksumLock.Lock() - defer checksumLock.Unlock() + checksumLock.RLock() + defer checksumLock.RUnlock() for _, migration := range encoderMigrationChecksums { added := false migrationEncoding := EncodeKeyAndValueForChecksum(key, value, migration.BlockHeight)