mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-03 05:28:38 +00:00
Merge 202e35e79a into 12eabbd76d
This commit is contained in:
commit
672fb75de0
1 changed files with 12 additions and 3 deletions
|
|
@ -196,12 +196,21 @@ func (tracker *TxTracker) loop() {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
// Setup the writer for the upcoming transactions
|
// Setup the writer for the upcoming transactions.
|
||||||
if err := tracker.journal.setupWriter(); err != nil {
|
// Hold the mutex to avoid racing with recheck/TrackAll
|
||||||
|
// which also access journal.writer.
|
||||||
|
tracker.mu.Lock()
|
||||||
|
err := tracker.journal.setupWriter()
|
||||||
|
tracker.mu.Unlock()
|
||||||
|
if err != nil {
|
||||||
log.Error("Failed to setup the journal writer", "err", err)
|
log.Error("Failed to setup the journal writer", "err", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer tracker.journal.close()
|
defer func() {
|
||||||
|
tracker.mu.Lock()
|
||||||
|
tracker.journal.close()
|
||||||
|
tracker.mu.Unlock()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
lastJournal = time.Now()
|
lastJournal = time.Now()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue