Merge pull request #9182 from filecoin-project/jen/9169
fix: ux: exclude negative available balance from spendable amount
This commit is contained in:
commit
e165731b82
@ -292,7 +292,10 @@ func handleMiningInfo(ctx context.Context, cctx *cli.Context, fullapi v0api.Full
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return xerrors.Errorf("getting available balance: %w", err)
|
return xerrors.Errorf("getting available balance: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if availBalance.GreaterThan(big.Zero()) {
|
||||||
spendable = big.Add(spendable, availBalance)
|
spendable = big.Add(spendable, availBalance)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf("Miner Balance: %s\n", color.YellowString("%s", types.FIL(mact.Balance).Short()))
|
fmt.Printf("Miner Balance: %s\n", color.YellowString("%s", types.FIL(mact.Balance).Short()))
|
||||||
fmt.Printf(" PreCommit: %s\n", types.FIL(lockedFunds.PreCommitDeposits).Short())
|
fmt.Printf(" PreCommit: %s\n", types.FIL(lockedFunds.PreCommitDeposits).Short())
|
||||||
|
Loading…
Reference in New Issue
Block a user