Skip to content

Commit ba54c07

Browse files
authored
Merge pull request #772 from evenevent/master
refactor: use the built-in max/min to simplify the code
2 parents 21d3c21 + cdc9b7c commit ba54c07

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

rocketpool/watchtower/utils/utils.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,13 @@ const (
2323
// Get the max fee for watchtower transactions
2424
func GetWatchtowerMaxFee(cfg *config.RocketPoolConfig) float64 {
2525
setting := cfg.Smartnode.WatchtowerMaxFeeOverride.Value.(float64)
26-
if setting < MinWatchtowerMaxFee {
27-
return MinWatchtowerMaxFee
28-
}
29-
return setting
26+
return max(MinWatchtowerMaxFee, setting)
3027
}
3128

3229
// Get the priority fee for watchtower transactions
3330
func GetWatchtowerPrioFee(cfg *config.RocketPoolConfig) float64 {
3431
setting := cfg.Smartnode.WatchtowerPrioFeeOverride.Value.(float64)
35-
if setting < MinWatchtowerPriorityFee {
36-
return MinWatchtowerPriorityFee
37-
}
38-
return setting
32+
return max(MinWatchtowerPriorityFee, setting)
3933
}
4034

4135
func FindLastBlockWithExecutionPayload(bc beacon.Client, slotNumber uint64) (beacon.BeaconBlock, error) {

0 commit comments

Comments
 (0)