0

I would like to track balances using address, but I have a few questions.

  1. If I don't use the rescan option, will the balance be incorrect?
  2. Why is the balance off when I check it against an external balance inquiry site?

The procedure using the API was to execute importaddress(no rescan) and then getbalances.

Because the balance was off, I executed importaddress with rescan, but the balance was off when I tried again.

I tried several times with other addresses, but it didn't work!
Should I change Wallet every time I look up a different address?

For example,

❯ curl --user user:password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "importaddress", "params": [ "38XnPvu9PmonFU9WouPXUjYbW91wa5MerL", "", false ]}' -H 'content-type: text/plain;' http://--.--.--.--:----
{"result":null,"error":null,"id":"curltest"}

❯ curl --user user:password --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getbalances", "params": []}' -H 'content-type: text/plain;' http://--.--.--.--:---- | jq .
{
  "result": {
    "mine": {
      "trusted": 0,
      "untrusted_pending": 0,
      "immature": 0
    },
    "watchonly": {
      "trusted": 3239.83164697,
      "untrusted_pending": 16.05599144,
      "immature": 184.81980076
    }
  },
  "error": null,
  "id": "curltest"
}

However, when referring to an external site, it is significantly off.
https://chainflyer.bitflyer.jp/tool/balance enter image description here

Any advice would be greatly appreciated!

1 Answer 1

0

If I don't use the rescan option, will the balance be incorrect?

Definitely. Without rescanning, the wallet won't know about any transactions that affect your balance.

Why is the balance off when I check it against an external balance inquiry site?

There is no way to answer that without knowing what you were looking at, or what you were expecting. Please update your question with details like which address you imported, what else is imported in your wallet, and what reference you used to compare with.

3
  • Thanks for getting back to me! I've updated the question, what do you think?
    – Satish
    Commented Aug 4, 2022 at 0:25
  • Are you importing multiple addresses into the same wallet? getbalances (and other balance RPCs) report the balance of the entire wallet. Commented Aug 4, 2022 at 2:28
  • That's right! Thanks to you I understand about getbalances. So if I want to import other addresses, I have to separate Wallet. Or is there an API to remove the import of addresses?
    – Satish
    Commented Aug 4, 2022 at 4:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.