fix possible race condition
This commit is contained in:
parent
d2711b0104
commit
13686ad80c
@ -24,7 +24,7 @@ const (
|
|||||||
VersionMajor = 1 // Major version component of the current release
|
VersionMajor = 1 // Major version component of the current release
|
||||||
VersionMinor = 10 // Minor version component of the current release
|
VersionMinor = 10 // Minor version component of the current release
|
||||||
VersionPatch = 15 // Patch version component of the current release
|
VersionPatch = 15 // Patch version component of the current release
|
||||||
VersionMeta = "statediff-3.0.0" // Version metadata to append to the version string
|
VersionMeta = "statediff-3.0.1" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version holds the textual version string.
|
// Version holds the textual version string.
|
||||||
|
@ -150,8 +150,10 @@ func (sdi *StateDiffIndexer) PushBlock(block *types.Block, receipts types.Receip
|
|||||||
dbtx: tx,
|
dbtx: tx,
|
||||||
// handle transaction commit or rollback for any return case
|
// handle transaction commit or rollback for any return case
|
||||||
submit: func(self *BatchTx, err error) error {
|
submit: func(self *BatchTx, err error) error {
|
||||||
close(self.quit)
|
defer func() {
|
||||||
close(self.iplds)
|
close(self.quit)
|
||||||
|
close(self.iplds)
|
||||||
|
}()
|
||||||
if p := recover(); p != nil {
|
if p := recover(); p != nil {
|
||||||
rollback(sdi.ctx, tx)
|
rollback(sdi.ctx, tx)
|
||||||
panic(p)
|
panic(p)
|
||||||
|
Loading…
Reference in New Issue
Block a user