This commit is contained in:
Denali Marsh 2020-12-04 15:35:26 +01:00 committed by GitHub
parent 4c95227c1d
commit 6aa97a8f75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -231,7 +231,9 @@ func (k Keeper) ValidateBorrow(ctx sdk.Context, borrower sdk.AccAddress, amount
func (k Keeper) IncrementBorrowedCoins(ctx sdk.Context, newCoins sdk.Coins) { func (k Keeper) IncrementBorrowedCoins(ctx sdk.Context, newCoins sdk.Coins) {
borrowedCoins, found := k.GetBorrowedCoins(ctx) borrowedCoins, found := k.GetBorrowedCoins(ctx)
if !found { if !found {
k.SetBorrowedCoins(ctx, newCoins) if !newCoins.Empty() {
k.SetBorrowedCoins(ctx, newCoins)
}
} else { } else {
k.SetBorrowedCoins(ctx, borrowedCoins.Add(newCoins...)) k.SetBorrowedCoins(ctx, borrowedCoins.Add(newCoins...))
} }