importprivkey found bitcoins even with rescan set to false #10666

Open
FrozenPrincess opened this Issue Jun 24, 2017 · 3 comments

Comments

Projects
None yet
2 participants

I imported a private key to a funded address with importprivkey {privateKey} "" false expecting that the wallet would only know about future transactions to this address. However it immediately found the funds (which had 4 confirmations), despite rescan set to false. My expectation was that it would only find funds for future transactions. Looking at the source code I can't see how this would happen and how many blocks it actually does scan back.

I'm not sure if the current behavior is intended or not, but it could be made a lot more clear

Owner

laanwj commented Jun 24, 2017

Did it do a rescan?
(hard to miss, your node would hang for some time and it prints to debug.log)

laanwj added the Wallet label Jun 24, 2017

FrozenPrincess commented Jun 24, 2017 edited

Yeah, there was no rescan. I am able to reproduce by:

Create an address on bitaddress.org
Send some bitcoin to that address
Wait until the bitcoin have got a couple of confirmations
Check the balance
Import private key with false set for rescan
Check the balance, and see that it found the money

I'm also totally sure I didn't run with rescan, because if I try:

Rescan is disabled in pruned mode (code -4)

laanwj added the RPC/REST/ZMQ label Jun 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment