This bug has been around for a while (at least 0.17 from what I remember) but I guess no one opened an issue for it. I also have been unable to debug this at all.
Sometimes, when importing public keys and scripts which already have a balance, the balance is not detected after the import’s rescan finishes. This has particularly occurred with the use of importmulti
(but I suspect it should happen with the other import
commands, I just don’t use those). Even with the timestamp set correctly and with repeated rescans afterwards using rescanblockchain
, no balance is found. However later transactions involving those keys and scripts are found.
Attempts to debug this have not been successful as this does not appear to be reproducible (attempts to intentionally reproduce this have failed).
It is possible that this is due to user error (perhaps some timestamp thing), but if that is the case, we should probably remove this footgun.
This issue was also described in an importmulti related PR some time ago. I’m trying to find that comment.