How does the wallet prioritise keypool addresses imported via importmulti?

1

I want to use importmulti to import 100 addresses from an xpub descriptor.

If I set keypool: true as one of the arguments the keys get added to the keypool.

How does the wallet prioritise which keys it generates when calling getnewaddress? Will it prioritise the imported addresses or do I have to request the imported address via the label argument in getnewaddress? What if I don't add a label argument to the importmulti command?

Fontaine

Posted 2019-05-09T18:28:24.397

Reputation: 158

Answers

0

There is no guarantee of the order by the API. But its currently FIFO (first in first out).

If the order/remembering is important to you, consider using fundrawtransaction with a wallet where you have private keys disabled createwallet "name" true. Just import pubkeys define the change output address in fundrawtransaction.

Jonas Schnelli

Posted 2019-05-09T18:28:24.397

Reputation: 5 465