#9294 introduced internal HD chain.
This made ReserveKeyFromPool iterates on the whole keypool (One disk access per key) to find a key matching internal
.
This PR changes the way TopUpKeyPool
creates keys in the pool.
Instead of creating all the external keys followed by all the internal keys (which would provoke lots of disk hit in ReserveKeyFromPool
if internal
is true
), it alternates them.