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.
bool SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAmount& nTargetValue, std::set<CInputCoin>& setCoinsRet, CAmount& nValueRet, const CCoinControl *coinControl = nullptr) const;
    CWalletDB *pwalletdbEncryption;
    
    int nWalletVersion;
    
    int nWalletMaxVersion;
    int64_t nNextResend;
    int64_t nLastResend;
    bool fBroadcastTransactions;
    /**
     * Used to keep track of spent outpoints, and
     * detect and report conflicts (double-spends or
     * mutated transactions where the mutant gets mined).
     */
    typedef std::multimap<COutPoint, uint256> TxSpends;
    TxSpends mapTxSpends;
    void AddToSpends(const COutPoint& outpoint, const uint256& wtxid);
    void AddToSpends(const uint256& wtxid);
    
    void MarkConflicted(const uint256& hashBlock, const uint256& hashTx);
    void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
    /* Used by TransactionAddedToMemorypool/BlockConnected/Disconnected.
     * Should be called with pindexBlock and posInBlock if this is for a transaction that is included in a block. */
    void SyncTransaction(const CTransactionRef& tx, const CBlockIndex *pindex = nullptr, int posInBlock = 0);
    
    CHDChain hdChain;
    
    void DeriveNewChildKey(CWalletDB &walletdb, CKeyMetadata& metadata, CKey& secret, bool internal = false);
    std::set<int64_t> setInternalKeyPool;
    std::set<int64_t> setExternalKeyPool;