The restore height works as follows. It will pull block hashes up till the restore height and scan blocks from the restore height on. Scanning blocks is defined as scanning a block and checking for each transaction included in the block whether rA == aR
(alternatively denoted as D == D'
). If this "checks out" a transaction is "credited" to your address.
Now, if you specify a restore height after the first transaction to your wallet, the wallet will "miss" this transaction and thus report an erroneous balance after the wallet refresh has completed. Thus, you have to set a restore height before the height of the first transaction to your wallet. In addition, I generally advise to add a margin of safety, i.e., subtract 20k blocks from the height of the first transaction to your wallet. For example, if the first transaction to your wallet was included in block 1450000
, use 1430000
.
To obtain the height of the first transaction to your wallet, simply enter the transaction ID / hash into a blockchain explorer like, for instance, XMRchain. If you don't have the transaction ID / hash, but do remember an approximate date, you can "trial-and-error" the blockchain for an approximate height. For example, block 1350000 was mined in the beginning of July 2017, whereas block 1250000 was mined in the end of February 2017. Note that each month approximately has 22k blocks (30.5*720). Thus, as quick arithmetic trick, you can take the current height and subtract 22k blocks for each month in order to obtain a proper restore height.
Lastly, note that the wallet creation height works similar. That is, upon creation of a wallet, the wallet will use the daemon (monerod) top block height as wallet creation height (an approximation will be used if the wallet is not connected to a daemon). It will then pull block hashes up till the wallet creation height and scan blocks from the wallet creation height on.