remove accounts with less than 1 snt from holderCount
This commit is contained in:
parent
71849f783f
commit
a6242eea25
|
@ -46,6 +46,9 @@ export function increaseAccountBalance(account: Account, token: Token, amount: B
|
||||||
export function decreaseAccountBalance(account: Account, token: Token, amount: BigDecimal): AccountBalance {
|
export function decreaseAccountBalance(account: Account, token: Token, amount: BigDecimal): AccountBalance {
|
||||||
let balance = getOrCreateAccountBalance(account, token)
|
let balance = getOrCreateAccountBalance(account, token)
|
||||||
balance.amount = balance.amount.minus(amount)
|
balance.amount = balance.amount.minus(amount)
|
||||||
|
if (balance.amount.lt(ONE.toBigDecimal())) {
|
||||||
|
token.holderCount = token.holderCount.minus(ONE)
|
||||||
|
}
|
||||||
|
|
||||||
return balance
|
return balance
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue