You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When handle orders, tran.unlock - tran.out is equal to zero and cause the problem.
func (kp *Keeper) doTransfer(ctx sdk.Context, tran *Transfer) sdk.Error {
account := kp.am.GetAccount(ctx, tran.accAddress).(types.NamedAccount)
newLocked := account.GetLockedCoins().Minus(sdk.Coins{sdk.NewCoin(tran.outAsset, tran.unlock)})
// these two non-negative check are to ensure the Transfer gen result is correct before we actually operate the acc.
// they should never happen, there would be a severe bug if happen and we have to cancel all orders when app restarts.
if !newLocked.IsNotNegative() {
panic(fmt.Errorf(
"no enough locked tokens to unlock, oid: %s, newLocked: %s, unlock: %d",
tran.Oid,
newLocked.String(),
tran.unlock))
}
if tran.unlock < tran.out {
panic(errors.New("unlocked tokens cannot cover the expense"))
}
account.SetLockedCoins(newLocked)
account.SetCoins(account.GetCoins().
Plus(sdk.Coins{sdk.NewCoin(tran.inAsset, tran.in)}).
Plus(sdk.Coins{sdk.NewCoin(tran.outAsset, tran.unlock-tran.out)}))
kp.am.SetAccount(ctx, account)
kp.logger.Debug("Performed Trade Allocation", "account", account, "allocation", tran.String())
return nil
}
The text was updated successfully, but these errors were encountered:
For the account:
https://dex-atlantic.binance.org/api/v1/account/bnb1xwalxpaes9r0z0fqdy70j3kz6aayetegur38gl
MDAB-D42
,BOLT-4C6
,AWC-986
get zero balance, while the account have holdBHFT-BBE
before but did not show it.The reason is that
AWC-986
is sold by order, whileBHFT-BBE
is transferred to others.refer: https://explorer.binance.org/api/v1/txs?address=bnb1xwalxpaes9r0z0fqdy70j3kz6aayetegur38gl&txAsset=AWC-986&page=1&rows=100
When handle orders,
tran.unlock - tran.out
is equal to zero and cause the problem.The text was updated successfully, but these errors were encountered: