Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pendingBalanceBig := int64(p)
- walletHistory := []store.TransactionETH{}
- err = restClient.userStore.GetAllWalletEthTransactions(user.UserID, wallet.CurrencyID, wallet.NetworkID, &walletHistory)
- for _, tx := range walletHistory {
- if tx.WalletIndex == wallet.WalletIndex {
- if (tx.Status == store.TxStatusAppearedInMempoolIncoming || tx.Status == store.TxStatusAppearedInMempoolOutcoming) && (tx.From == address.Address || tx.To == address.Address) {
- if tx.Status == store.TxStatusAppearedInMempoolIncoming && p == b {
- inTxAmount, _ := new(big.Int).SetString(tx.Amount, 10)
- in := inTxAmount.Int64()
- pendingBalanceBig += in
- pendingBalance = strconv.Itoa(int(pendingBalanceBig))
- restClient.log.Warnf("\n Incoming Wallet name %v pending fake balance %v", wallet.WalletName, pendingBalance)
- restClient.log.Warnf("\n Incoming node balance %v node pending balance %v", b, p)
- }
- if tx.Status == store.TxStatusAppearedInMempoolOutcoming && p == b {
- // oldPending := pendingBalanceBig
- outTxAmount, _ := new(big.Int).SetString(tx.Amount, 10)
- out := outTxAmount.Int64()
- pendingBalanceBig -= out
- fee := tx.GasLimit * tx.GasPrice
- pendingBalanceBig -= fee
- pendingBalance = big.NewInt(pendingBalanceBig).String()
- restClient.log.Warnf("\n Outcoming Wallet name %v pending fake balance %v", wallet.WalletName, pendingBalance)
- restClient.log.Warnf("\n Outcoming node balance %v node pending balance %v", b, p)
- }
- pending = true
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement