diff --git a/rocketpool-cli/node/claim-unclaimed-rewards.go b/rocketpool-cli/node/claim-unclaimed-rewards.go index c49007627..88c690a6c 100644 --- a/rocketpool-cli/node/claim-unclaimed-rewards.go +++ b/rocketpool-cli/node/claim-unclaimed-rewards.go @@ -31,12 +31,13 @@ func claimUnclaimedRewards(yes bool) error { fmt.Printf("The node's withdrawal address is %s\n", status.PrimaryWithdrawalAddress) if status.UnclaimedRewards != nil && status.UnclaimedRewards.Cmp(big.NewInt(0)) > 0 { fmt.Printf("You have %.6f ETH in unclaimed rewards.\n", math.RoundDown(math.WeiToEth(status.UnclaimedRewards), 6)) - fmt.Printf("Your node %s's rewards were distributed, but the withdrawal address (at the time of distribution) was unable to accept ETH. ", + fmt.Printf("Your node %s has rewards that were distributed to its unclaimed rewards balance instead of its withdrawal address. ", color.LightBlue(status.AccountAddress.String())) - fmt.Println("Before continuing, please use the command `rocketpool node set-primary-withdrawal-address` to configure an address that can accept ETH") + fmt.Println("This happens whenever your fee distributor is distributed by anyone other than your node or withdrawal address.") + fmt.Println("Claiming will send them to your current withdrawal address.") } else { fmt.Println("You have no unclaimed rewards.") - fmt.Println("Unclaimed rewards occur when a withdrawal address cannot accept ETH during distribution.") + fmt.Println("Unclaimed rewards occur when your fee distributor is distributed by anyone other than your node or withdrawal address.") fmt.Println("If you have unclaimed rewards in the future, you can use this command to claim them.") return nil } @@ -44,8 +45,13 @@ func claimUnclaimedRewards(yes bool) error { // Check the node can claim unclaimed rewards canClaim, err := rp.CanClaimUnclaimedRewards(status.AccountAddress) if err != nil { + fmt.Println("Could not claim unclaimed rewards. If your current withdrawal address cannot accept ETH, use `rocketpool node set-primary-withdrawal-address` to reconfigure your withdrawal address.") return err } + if !canClaim.CanClaim { + fmt.Println("You have no unclaimed rewards.") + return nil + } // Assign max fees err = gas.AssignMaxFeeAndLimit(canClaim.GasLimits, rp, yes) diff --git a/rocketpool/api/node/claim-unclaimed-rewards.go b/rocketpool/api/node/claim-unclaimed-rewards.go index a8e742b25..fd468021c 100644 --- a/rocketpool/api/node/claim-unclaimed-rewards.go +++ b/rocketpool/api/node/claim-unclaimed-rewards.go @@ -33,8 +33,9 @@ func canClaimUnclaimedRewards(c *cli.Command, nodeAddress common.Address) (*api. return nil, err } - if unclaimedRewards != nil { - response.CanClaim = false + response.CanClaim = unclaimedRewards != nil && unclaimedRewards.Sign() > 0 + if !response.CanClaim { + return &response, nil } // Get gas estimate @@ -46,7 +47,6 @@ func canClaimUnclaimedRewards(c *cli.Command, nodeAddress common.Address) (*api. if err != nil { return nil, err } - response.CanClaim = true return &response, nil