Bitcoin Forum
May 22, 2024, 03:03:36 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why does Bitcoin Core -prune not show the balance of imported addresses?  (Read 784 times)
tsoPANos (OP)
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500

In math we trust.


View Profile
January 06, 2017, 01:01:35 PM
Last edit: January 06, 2017, 02:31:43 PM by tsoPANos
 #1

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?
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
January 06, 2017, 01:07:40 PM
 #2

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.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
tsoPANos (OP)
Hero Member
*****
Offline Offline

Activity: 602
Merit: 500

In math we trust.


View Profile
January 06, 2017, 02:46:06 PM
 #3

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?
Lauda
Legendary
*
Offline Offline

Activity: 2674
Merit: 2965


Terminated.


View Profile WWW
January 06, 2017, 02:47:57 PM
Last edit: January 06, 2017, 03:00:06 PM by Lauda
 #4

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.

"The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
😼 Bitcoin Core (onion)
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3402
Merit: 6642


Just writing some code


View Profile WWW
January 06, 2017, 03:23:52 PM
 #5

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!