Skip to content

Commit

Permalink
fix: panic in FundManager
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Nov 11, 2020
1 parent 6f593d5 commit 6184d22
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions chain/market/fundmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (a *fundedAddress) processReservations(reservations []*fundRequest, release

// Work out the amount to add to the balance
amtToAdd := abi.NewTokenAmount(0)
if reserved.GreaterThan(abi.NewTokenAmount(0)) {
if len(toAdd) > 0 && reserved.GreaterThan(abi.NewTokenAmount(0)) {
// Get available funds for address
avail, err := a.env.AvailableFunds(a.ctx, a.state.Addr)
if err != nil {
Expand Down Expand Up @@ -487,9 +487,9 @@ func (a *fundedAddress) processWithdrawals(withdrawals []*fundRequest) (msgCid c
// the rest
withdrawalAmt := abi.NewTokenAmount(0)
allowedAmt := abi.NewTokenAmount(0)
allowed := make([]*fundRequest, 0, len(a.withdrawals))
allowed := make([]*fundRequest, 0, len(withdrawals))
var batchWallet address.Address
for _, req := range a.withdrawals {
for _, req := range withdrawals {
amt := req.Amount()
if amt.IsZero() {
// If the context for the request was cancelled, bail out
Expand Down

0 comments on commit 6184d22

Please sign in to comment.