DeFiCh / DeFiCh/ain

gettokenbalances and getaccount sometimes cannot return BTC token balance

Open
#746 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
397
Forks
129
PR merge metrics
No merged PRs in 30d

Description

#### What happened:
When call getaccount and gettokenbalances, sometimes it cannot return the BTC balances

```
./src/defi-cli -testnet getaccount 7Jw72Q9yGJ1UWCXdQcUwkwSX48mkvdV2sS
[
"867.45064013@DFI",
"10100.00000000@ETH",
"10100.00000000@USDT",
"1.76692021@MOCK",
"10.21070861@MOCK-DFI"
]
```
The btc token ID is 1.
```
./src/defi-cli -testnet gettokenbalances
[
"867.45064013@0",
"10100.00000000@2",
"10100.00000000@5",
"1.76692021@8",
"10.21070861@9"
]
```

But after do a poolswap between DFI and BTC, then the BTC balances can show up.

```
./src/defi-cli -testnet poolswap "{\"from\":\"7Jw72Q9yGJ1UWCXdQcUwkwSX48mkvdV2sS\",\"tokenFrom\":\"DFI\",\"amountFrom\":\"1\",\"to\":\"7Jw72Q9yGJ1UWCXdQcUwkwSX48mkvdV2sS\",\"tokenTo\":\"BTC\",\"maxPrice\":\"100000.0\"}"
5e8be4ca3318948574b3f3b45829eeb15cf63c30547cade1afce8d9043bdc615
```
```
./src/defi-cli -testnet getaccount 7Jw72Q9yGJ1UWCXdQcUwkwSX48mkvdV2sS
[
"866.45064013@DFI",
"0.55820666@BTC",
"10100.00000000@ETH",
"10100.00000000@USDT",
"1.76692021@MOCK",
"10.21070861@MOCK-DFI"
]
```

```
./src/defi-cli -testnet gettokenbalances
[
"866.45064013@0",
"0.55820666@1",
"10100.00000000@2",
"10100.00000000@5",
"1.76692021@8",
"10.21070861@9"
]
```

#### What you expected to happen:

It should always show BTC token balances.

#### How to reproduce it (as minimally and precisely as possible):

It seems only happens to ICX maker bot node.

#### What are your environment parameters:

#### Anything else we need to know?:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.