Skip to content

Commit c718ddc

Browse files
committed
add flag txpool.commit_every
1 parent 7346c8f commit c718ddc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmd/txpool/main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ var (
5050
priceLimit uint64
5151
accountSlots uint64
5252
priceBump uint64
53+
54+
commitEvery time.Duration
5355
)
5456

5557
func init() {
@@ -71,6 +73,7 @@ func init() {
7173
rootCmd.PersistentFlags().Uint64Var(&priceLimit, "txpool.pricelimit", txpool.DefaultConfig.MinFeeCap, "Minimum gas price (fee cap) limit to enforce for acceptance into the pool")
7274
rootCmd.PersistentFlags().Uint64Var(&accountSlots, "txpool.accountslots", txpool.DefaultConfig.AccountSlots, "Minimum number of executable transaction slots guaranteed per account")
7375
rootCmd.PersistentFlags().Uint64Var(&priceBump, "txpool.pricebump", txpool.DefaultConfig.PriceBump, "Price bump percentage to replace an already existing transaction")
76+
rootCmd.PersistentFlags().DurationVar(&commitEvery, "txpool.commit_every", txpool.DefaultConfig.CommitEvery, "How often transactions should be committed to the storage")
7477
rootCmd.Flags().StringSliceVar(&traceSenders, utils.TxPoolTraceSendersFlag.Name, []string{}, utils.TxPoolTraceSendersFlag.Usage)
7578
}
7679

@@ -131,7 +134,7 @@ func doTxpool(ctx context.Context) error {
131134
dirs := datadir.New(datadirCli)
132135

133136
cfg.DBDir = dirs.TxPool
134-
cfg.CommitEvery = 30 * time.Second
137+
cfg.CommitEvery = commitEvery
135138
cfg.PendingSubPoolLimit = pendingPoolLimit
136139
cfg.BaseFeeSubPoolLimit = baseFeePoolLimit
137140
cfg.QueuedSubPoolLimit = queuedPoolLimit

0 commit comments

Comments
 (0)