Skip to content

Commit

Permalink
fix: whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikelle committed Apr 29, 2024
1 parent a9a56e6 commit 042a5cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/pkg/depositmanager/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,19 +204,19 @@ func (dm *DepositManager) CheckAndDeductDeposit(ctx context.Context, address com
if balanceToCheck == nil {
balanceToCheck = defaultBalance
}

// Check if the balance is sufficient to cover the bid amount
if balanceToCheck != nil && balanceToCheck.Cmp(bidAmount) >= 0 {
newBalance = new(big.Int).Sub(balanceToCheck, bidAmount)
} else {
return nil, status.Errorf(codes.FailedPrecondition, "insufficient balance")
}

if err := dm.store.SetBalanceForBlock(address, newBalance, blockNumber); err != nil {
dm.logger.Error("setting balance", "error", err)
return nil, status.Errorf(codes.Internal, "failed to set balance: %v", err)
}

return newBalance, nil
}

Expand Down

0 comments on commit 042a5cc

Please sign in to comment.