handshake-org / handshake-org/hsd
getwalletinfo rpc return incorrect data
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
hello guys,
When I use `getwalletinfo` rpc to query data, I suspect that *balance* is equal to *unconfirmed_balance* according to the returned data, which may be wrong.
So I lookup the code about `getwalletinfo`, which is as follows in the `getWalletInfo` function body:
```
return {
walletid: wallet.id,
walletversion: 6,
balance: Amount.coin(balance.unconfirmed, true),
unconfirmed_balance: Amount.coin(balance.unconfirmed, true),
txcount: balance.tx,
keypoololdest: 0,
keypoolsize: 0,
unlocked_until: wallet.master.until,
paytxfee: Amount.coin(this.wdb.feeRate, true)
};
```
Is this a bug ?
Contributor guide
Research direction
Start at the getWalletInfo function shown in the issue and trace how balance is populated for the getwalletinfo RPC. Compare the sources used for balance and unconfirmed_balance, then verify the response with a wallet containing confirmed and unconfirmed funds. Done means the fields report their intended values, with a regression test if this RPC has existing coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100