```
wallet/scriptpubkeyman.cpp: In member function ‘virtual bool LegacyScriptPubKeyMan::Upgrade(int, bilingual_str&)’:
wallet/scriptpubkeyman.cpp:455:55: warning: logical ‘and’ applied to non-boolean constant [-Wlogical-op]
  455 |     if (m_storage.CanSupportFeature(FEATURE_HD_SPLIT) && CHDChain::VERSION_HD_CHAIN_SPLIT) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CXX      wallet/libbitcoin_wallet_a-wallet.o
```
```
$ gcc --version
gcc (Gentoo 9.2.0-r2 p3) 9.2.0
```
Related - #19015.
{
    LOCK(cs_KeyStore);
    if (m_storage.IsLocked()) return false;
    auto it = m_inactive_hd_chains.find(seed_id);
    if (it == m_inactive_hd_chains.end()) {
        return false;
    }
    CHDChain& chain = it->second;
    
    int64_t target_size = std::max(gArgs.GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t) 1);
    
    
    int64_t kp_size = (internal ? chain.nInternalChainCounter : chain.nExternalChainCounter) - (index + 1);
    
    int64_t missing = std::max(target_size - kp_size, (int64_t) 0);
    if (missing > 0) {
        WalletBatch batch(m_storage.GetDatabase());
        for (int64_t i = missing; i > 0; --i) {
            GenerateNewKey(batch, chain, internal);
        }
        if (internal) {
            WalletLogPrintf("inactive seed with id %s added %d internal keys\n", HexStr(seed_id), missing);
        } else {
            WalletLogPrintf("inactive seed with id %s added %d keys\n", HexStr(seed_id), missing);
        }
    }
    return true;
}
void LegacyScriptPubKeyMan::MarkUnusedAddresses(const CScript& script)