fix: format fund manager message fil amounts

This commit is contained in:
Dirk McCormick 2021-01-06 09:23:54 +01:00
parent 3287c621ad
commit e8e4b559e9

View File

@ -502,11 +502,11 @@ func (a *fundedAddress) processWithdrawals(withdrawals []*fundRequest) (msgCid c
// request with an error
newWithdrawalAmt := types.BigAdd(withdrawalAmt, amt)
if newWithdrawalAmt.GreaterThan(netAvail) {
msg := fmt.Sprintf("insufficient funds for withdrawal of %d: ", amt)
msg += fmt.Sprintf("net available (%d) = available (%d) - reserved (%d)",
types.BigSub(netAvail, withdrawalAmt), avail, a.state.AmtReserved)
msg := fmt.Sprintf("insufficient funds for withdrawal of %s: ", types.FIL(amt))
msg += fmt.Sprintf("net available (%s) = available (%s) - reserved (%s)",
types.FIL(types.BigSub(netAvail, withdrawalAmt)), types.FIL(avail), types.FIL(a.state.AmtReserved))
if !withdrawalAmt.IsZero() {
msg += fmt.Sprintf(" - queued withdrawals (%d)", withdrawalAmt)
msg += fmt.Sprintf(" - queued withdrawals (%s)", types.FIL(withdrawalAmt))
}
err := xerrors.Errorf(msg)
a.debugf("%s", err)