From 5bac720fd49624cfc9132761d6809178655d7416 Mon Sep 17 00:00:00 2001 From: Kyrin Date: Thu, 16 Oct 2025 11:52:52 +0800 Subject: [PATCH] Initialize journal writer soon after loading instead of waiting for the first time rejournal. Previously, the journal writer is nil until the first time rejournal (default 1h), which means during this period, txs submitted to this node are not written into journal file. --- core/txpool/locals/tx_tracker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/txpool/locals/tx_tracker.go b/core/txpool/locals/tx_tracker.go index e08384ce71..fe77847cf2 100644 --- a/core/txpool/locals/tx_tracker.go +++ b/core/txpool/locals/tx_tracker.go @@ -185,6 +185,12 @@ func (tracker *TxTracker) loop() { tracker.TrackAll(transactions) return nil }) + + log.Info("Initializing journal writer after loading transactions") + if err := tracker.journal.rotate(make(map[common.Address]types.Transactions)); err != nil { + log.Warn("Failed to initialize journal writer", "err", err) + } + defer tracker.journal.close() } var (