The wallet-set-lookahead-size
command in Mintlayer is used to set the lookahead size for key generation in the wallet. The lookahead size, also known as the gap limit, determines the number of addresses to generate and monitor on the blockchain for incoming transactions, following the last known address with a transaction.
Understanding Lookahead Size: The lookahead size is a critical parameter in wallet address management. It affects how the wallet tracks and identifies transactions associated with the wallet's addresses.
Risks of Reducing Lookahead Size: Reducing the lookahead size can lead to missed transactions if there are incoming transactions to addresses beyond the new reduced size. Only reduce this value if you are certain there are no incoming transactions on these addresses.
wallet-set-lookahead-size <LOOKAHEAD_SIZE> [I_KNOW_WHAT_I_AM_DOING]
<LOOKAHEAD_SIZE>
: The new lookahead size (number of addresses).[I_KNOW_WHAT_I_AM_DOING]
: An optional flag that forces the reduction of the lookahead size even below the known last used address. This can lead to the wallet losing track of known addresses and balance. Use with caution and only if you fully understand the implications. Possible value: i-know-what-i-am-doing
.-h, --help
: Displays help information about the wallet-set-lookahead-size
command.Setting the Lookahead Size:
To set the lookahead size to 21 addresses, the command would be:
wallet-set-lookahead-size 21
Upon successful execution, a confirmation message will appear:
Success. Lookahead size has been updated, will rescan the blockchain.
This indicates that the lookahead size has been adjusted and the wallet will rescan the blockchain to align with the new setting.
Note: Adjusting the lookahead size should be done with a thorough understanding of how it impacts the tracking of transactions and balances within your wallet.