Skip to content

Commit

Permalink
Better staking config error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xmariachi committed Jan 16, 2025
1 parent 2e919bb commit 1677e3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/repo_tx_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ func (node *NodeConfig) RegisterAndStakeReputerIdempotently(ctx context.Context,
}

minStake := config.MinStake.Number
if minStake.IsNil() {
log.Info().Msg("No minimum stake configured in reputer, skipping adding stake.")
return true, nil
}
if minStake.IsZero() {
log.Info().Msg("No minimum stake requested, skipping adding stake.")
return true, nil
}
if minStake.LTE(stake) {
log.Info().Interface("stake", stake).Interface("minStake", minStake).Msg("Stake above minimum requested stake, skipping adding stake.")
return true, nil
Expand Down

0 comments on commit 1677e3a

Please sign in to comment.