Built against `master` branch 801dd40666d1e6009920ad3ff755c7bb993b2a62:

If I have no wallet.dat file and run:

    bitcoind -usehd=0

A new wallet.dat file is created and an HD seed is assigned.

I see an error message in the source:

    "Error loading %s: You can't disable HD on an already existing HD wallet or create new non-HD wallets."

but that doesn't get shown because `fFirstRun` is true, and so the code which checks for `-usehd` values doesn't run.

If it's no longer possible to create non-HD wallets, specifying -usehd=0 when creating a wallet should be an error, and not get silently ignored.
* have appeared in a new transaction. If so, remove those keys from the keypool.
             * This can happen when restoring an old wallet backup that does not contain
             * the mostly recently created transactions from newer versions of the wallet.
             */
            
            for (const CTxOut& txout: tx.vout) {
                
                std::vector<CKeyID> vAffected;
                CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey);
                for (const CKeyID &keyid : vAffected) {
                    std::map<CKeyID, int64_t>::const_iterator mi = m_pool_key_to_index.find(keyid);
                    if (mi != m_pool_key_to_index.end()) {
                        LogPrintf("%s: Detected a used keypool key, mark all keypool key up to this key as used\n", __func__);
                        MarkReserveKeysAsUsed(mi->second);
                        if (!TopUpKeyPool()) {
                            LogPrintf("%s: Topping up keypool failed (locked wallet)\n", __func__);
                        }
                    }
                }
            }
            CWalletTx wtx(this, ptx);
            
            if (pIndex != nullptr)
                wtx.SetMerkleBranch(pIndex, posInBlock);
            return AddToWallet(wtx, false);
        }
    }
    return false;
}
bool CWallet::TransactionCanBeAbandoned(const uint256& hashTx) const