cmd/utils: validates trimmed string but parses the untrimmed one (#35116)

This commit is contained in:
cui 2026-06-09 02:25:32 +08:00 committed by GitHub
parent 31d227ea83
commit e774a8fca0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1617,7 +1617,7 @@ func setTxPool(ctx *cli.Context, cfg *legacypool.Config) {
if trimmed := strings.TrimSpace(account); !common.IsHexAddress(trimmed) { if trimmed := strings.TrimSpace(account); !common.IsHexAddress(trimmed) {
Fatalf("Invalid account in --txpool.locals: %s", trimmed) Fatalf("Invalid account in --txpool.locals: %s", trimmed)
} else { } else {
cfg.Locals = append(cfg.Locals, common.HexToAddress(account)) cfg.Locals = append(cfg.Locals, common.HexToAddress(trimmed))
} }
} }
} }