Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spikeekips/97e0fdc272f2753ea22bd737e711811d to your computer and use it in GitHub Desktop.
Save spikeekips/97e0fdc272f2753ea22bd737e711811d to your computer and use it in GitHub Desktop.
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