Skip to content

Commit 13686ad

Browse files
committed
fix possible race condition
1 parent d2711b0 commit 13686ad

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

params/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const (
2424
VersionMajor = 1 // Major version component of the current release
2525
VersionMinor = 10 // Minor version component of the current release
2626
VersionPatch = 15 // Patch version component of the current release
27-
VersionMeta = "statediff-3.0.0" // Version metadata to append to the version string
27+
VersionMeta = "statediff-3.0.1" // Version metadata to append to the version string
2828
)
2929

3030
// Version holds the textual version string.

statediff/indexer/database/sql/indexer.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,10 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
150150
dbtx: tx,
151151
// handle transaction commit or rollback for any return case
152152
submit: func(self *BatchTx, err error) error {
153-
close(self.quit)
154-
close(self.iplds)
153+
defer func() {
154+
close(self.quit)
155+
close(self.iplds)
156+
}()
155157
if p := recover(); p != nil {
156158
rollback(sdi.ctx, tx)
157159
panic(p)

0 commit comments

Comments
 (0)