Author

Topic: Why does Bitcoin Core -prune not show the balance of imported addresses? (Read 816 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
It seems that it needs to download the entire blockchain.
I was under the impression that this wouldn't be the case, as the full blockchain is only required
for the transaction history.
Am I wrong?
Bitcoin Core still needs to download and verify the entire blockchain in order to properly function. If it does not know what the current state of the blockchain is, it will not work. Thus it will still be downloading the entire blockchain. The difference between pruned mode and normal mode is that in pruned mode the blockchain will be deleted after it has been downloaded and verified. Only the latest blocks are kept just in case and those are deleted after they become too old.

This. I used importaddress "my-watch-only-address" "" false
With importaddress "my-watch-only-address" I got a "Rescan is ddisabled in pruned mode" error.
Rescanning does not work in pruned mode because the entire blockchain is needed. It has to scan through the entire blockchain for any transactions that pertain to the imported address, but it cannot do this in pruned mode because the entire blockchain is not stored. The reason the first command works is because there is an optional parameter which tells Bitcoin Core whether to rescan. Be default it is true, but you set it to false, so it does not rescan, just adds the address to the wallet.

I was wondering why would it need a rescan. I thought the full blockchain is needed only for the transaction history.
In case that someone doesn't care about the history, why would he just import an address of private key to check balance?
One of the purposes of Bitcoin Core is to serve as a wallet. Rescan is necessary so that the wallet functions properly and can spend all of the Bitcoin actually owned by the user. Because the vast majority of people who import addresses and private keys want to spend the Bitcoin associated with them, the import* methods by default will rescan so that the entire transaction history is known so that the Bitcoin can be properly spent.
legendary
Activity: 2674
Merit: 2965
Terminated.
This.
I was wondering why would it need a rescan. I thought the full blockchain is needed only for the transaction history.
It can't know the current balance / past transactions of a new address. When you import a private key via the console it will start re-scanning the whole chain until it finds the relevant information.

In case that someone doesn't care about the history, why would he just import an address of private key to check balance?
Computing the public key / address and checking via a blockchain explorer is the faster way. I'm not sure if there's an easy to use tool for that.
hero member
Activity: 602
Merit: 500
In math we trust.
I couldn't decipher exactly what you are asking in this case. Are you saying that:
1) You pruned your blockchain and then imported the address; or
2) You imported the address and then pruned the blockchain?

Keep in mind that '-rescan' is disabled in pruned mode (according to 0.12.0 release notes), thus importing an address will not show it's balance IIRC.


Thanks for the response.

Quote
1) You pruned your blockchain and then imported the address; or
This. I used importaddress "my-watch-only-address" "" false
With importaddress "my-watch-only-address" I got a "Rescan is ddisabled in pruned mode" error.

I was wondering why would it need a rescan. I thought the full blockchain is needed only for the transaction history.
In case that someone doesn't care about the history, why would he just import an address of private key to check balance?
legendary
Activity: 2674
Merit: 2965
Terminated.
I couldn't decipher exactly what you are asking in this case. Are you saying that:
1) You pruned your blockchain and then imported the address; or
2) You imported the address and then pruned the blockchain?

Keep in mind that '-rescan' is disabled in pruned mode (according to 0.12.0 release notes), thus importing an address will not show it's balance IIRC.
hero member
Activity: 602
Merit: 500
In math we trust.
It seems that it needs to download the entire blockchain.
I was under the impression that this wouldn't be the case, as the full blockchain is only required
for the transaction history.
Am I wrong?
Jump to: