Invalid json from getwalletinfo when scanning is in progress #20297

issue shesek opened this issue on November 4, 2020
  1. shesek commented at 7:00 AM on November 4, 2020: contributor

    I'm sometimes getting an invalid json reply from getwalletinfo when rescanning is in progress.

    The invalid part is this: "scanning":{"duration":19,"progress":}} (no value for progress).

    I can't reliably reproduce this, but I did manage to run into this 3 times now (once every 10-20 attempts or so).

    I'm running v0.20.0 and testing against a regtest instance. This happens while doing a batched importmulti of 2000 addresses (none of which have history).

  2. shesek added the label Bug on Nov 4, 2020
  3. shesek commented at 7:01 AM on November 4, 2020: contributor

    from #bitcoin-core-dev:

    <sipa> shesek: my theory is that somehow the begin and end of the rescan have the same progress value, so there is a division by zero
  4. MarcoFalke added the label RPC/REST/ZMQ on Nov 4, 2020
  5. MarcoFalke added the label Wallet on Nov 4, 2020
  6. theStack commented at 7:13 PM on November 8, 2020: member

    @shesek: Thank you for reporting this problem! sipa's theory was right, this happens whenever the begin and end of the rescan have the same progress value (which is the case for single block rescans). It can be easily reproduced by continuosly performing single block range rescans and then calling the getwalletinfo RPC a few times. I opened a PR to fix the problem (#20344) by assigning the progress value directly for this special case instead of using the formula, see its description for more details.

  7. shesek commented at 5:09 AM on November 9, 2020: contributor

    @theStack Thanks for swiftly investigating and fixing this!

  8. MarcoFalke closed this on Nov 11, 2020

  9. sidhujag referenced this in commit 952dd90c65 on Nov 11, 2020
  10. DrahtBot locked this on Feb 15, 2022
  11. PastaPastaPasta referenced this in commit 172a0dce2d on Apr 15, 2023
  12. PastaPastaPasta referenced this in commit 14f3856e92 on Apr 15, 2023
  13. PastaPastaPasta referenced this in commit b9bd8bff42 on Apr 16, 2023
  14. UdjinM6 referenced this in commit f8d32e7e1b on Apr 16, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me