Does `importprivkey` need a rescan even in a txindex=1 node?

0

Documentation for importprivkey RPC command has an optional boolean argument called "rescan" which hints that the user may want to rescan the blockchain to be able to see previous deposits to this address.

Is the rescan needed if the node is configured as txindex=1?

knocte

Posted 2017-06-23T05:42:25.880

Reputation: 1 531

Answers

3

Yes. txindex=1 is not related to the wallet and the wallet does not know about the txindex nor does it care. What the wallet really cares about is transaction output information and which transactions are related to addresses stored in the wallet. The txindex does not store any of that information, all it stores is the location of each transaction identified by transaction id. The actual contents of that transaction are not kept except in the raw transaction itself.

Andrew Chow

Posted 2017-06-23T05:42:25.880

Reputation: 40 910

is there any explicit RPC command to trigger rescan? Say I want to import an address but only do rescans according to some schedule (i.e. when I expect the load on my Bitcoin node to be least in a give 24-hour interval)?mecampbellsoup 2018-09-10T15:22:47.850

A rescan can be triggered using the rescanblockchain command.Andrew Chow 2018-09-10T15:52:04.053