(commit #1)
Changes the maximum upgradewallet version to the latest wallet version
number, 190700. Non-HD wallets will be upgraded to use HD derivation.
Non HD chain split wallets will be upgraded to HD chain split.
(commit #2)
After upgrading to HD chain split, we want to continue to use keys
from the old keypool. To do this, before we generate any new keys after
upgrading, we mark all of the keypool entries as being pre-chain
split and move them to a separate pre chain split keypool. Keys are
fetched from that keypool until it is emptied. Only then are the new
internal and external keypools used.
Since upgradewallet is effectively run during a first run, all of the
first run initial setup stuff is combined with the upgrade to HD
Partial backport of Core PR12560 (3/4)
https://github.com/bitcoin/bitcoin/pull/12560/commits/5c50e93d52c14fc7bc41130cdb1568f2c11e45de
https://github.com/bitcoin/bitcoin/pull/12560/commits/dfcd9f3e6abf3d53903227a085ff4cfecbfeb07f