Skip to content

Commit

Permalink
core/txpool: no need to run rotate if no local txs
Browse files Browse the repository at this point in the history
Signed-off-by: jsvisa <delweng@gmail.com>
  • Loading branch information
jsvisa committed Feb 26, 2024
1 parent 93c541a commit 17fab17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/txpool/legacypool/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ func (journal *journal) insert(tx *types.Transaction) error {
// rotate regenerates the transaction journal based on the current contents of
// the transaction pool.
func (journal *journal) rotate(all map[common.Address]types.Transactions) error {
// No need to rotate if there are no transactions to write
if len(all) == 0 {
return nil
}

// Close the current journal (if any is open)
if journal.writer != nil {
if err := journal.writer.Close(); err != nil {
Expand Down

0 comments on commit 17fab17

Please sign in to comment.