Skip to content

Commit 17fab17

Browse files
committed
core/txpool: no need to run rotate if no local txs
Signed-off-by: jsvisa <[email protected]>
1 parent 93c541a commit 17fab17

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/txpool/legacypool/journal.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ func (journal *journal) insert(tx *types.Transaction) error {
131131
// rotate regenerates the transaction journal based on the current contents of
132132
// the transaction pool.
133133
func (journal *journal) rotate(all map[common.Address]types.Transactions) error {
134+
// No need to rotate if there are no transactions to write
135+
if len(all) == 0 {
136+
return nil
137+
}
138+
134139
// Close the current journal (if any is open)
135140
if journal.writer != nil {
136141
if err := journal.writer.Close(); err != nil {

0 commit comments

Comments
 (0)