Created
September 13, 2023 05:35
-
-
Save spikeekips/97e0fdc272f2753ea22bd737e711811d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git isaac/block/localfs_writer.go isaac/block/localfs_writer.go | |
index 9bdfa2b9..eda6c126 100644 | |
--- isaac/block/localfs_writer.go | |
+++ isaac/block/localfs_writer.go | |
@@ -15,7 +15,6 @@ import ( | |
"strconv" | |
"strings" | |
"sync" | |
- "sync/atomic" | |
"github.com/pkg/errors" | |
"github.com/spikeekips/mitum/base" | |
@@ -56,7 +55,6 @@ type LocalFSWriter struct { | |
m BlockMap | |
networkID base.NetworkID | |
hint.BaseHinter | |
- lenops uint64 | |
height base.Height | |
saved bool | |
sync.Mutex | |
@@ -133,8 +131,6 @@ func (w *LocalFSWriter) SetOperation(_ context.Context, _ uint64, op base.Operat | |
return errors.Wrap(err, "set operation") | |
} | |
- atomic.AddUint64(&w.lenops, 1) | |
- | |
return nil | |
} | |
@@ -149,7 +145,7 @@ func (w *LocalFSWriter) SetOperationsTree(ctx context.Context, tw *fixedtree.Wri | |
if err := w.m.SetItem(NewLocalBlockMapItem( | |
base.BlockMapItemTypeOperations, | |
w.opsf.Checksum(), | |
- atomic.LoadUint64(&w.lenops), | |
+ uint64(tw.Len()), | |
)); err != nil { | |
return errors.Wrap(err, "set operations") | |
} | |
@@ -377,7 +373,6 @@ func (w *LocalFSWriter) close() error { | |
w.heightbase = "" | |
w.temp = "" | |
w.m = BlockMap{} | |
- w.lenops = 0 | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment