https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
return OutputTypeBECH32;
    }
    const bool has_p2sh_segwit_spkman(GetScriptPubKeyMan(OutputTypeP2SH_SEGWIT, /*internal
    if (has_p2sh_segwit_spkman && any_sh) {
        // Currently sh_wpkh is the only type supported by the P2SH_SEGWIT spkman
        // As of 2021 about 80% of all SH are wrapping WPKH, so use that
        return OutputTypeP2SH_SEGWIT;
    }
    const bool has_legacy_spkman(GetScriptPubKeyMan(OutputTypeLEGACY, /*internal
    if (has_legacy_spkman && any_pkh) {
        // Currently pkh is the only type supported by the LEGACY spkman
        return OutputTypeLEGACY;
    }
    if (has_bech32m_spkman) {
        return OutputTypeBECH32M;
    }
    if (has_bech32_spkman) {
        return OutputTypeBECH32;
    }
    // else use m_default_address_type for change
    return m_default_address_type;
}
void CWalletCommitTransaction(CTransactionRef tx, mapValue_t mapValue, stdvector<stdpair<stdstring, stdstring>> orderForm)
{
    LOCK(cs_);
    WalletLogPrintf("CommitTransaction\n%s", tx->ToString()); /* Continued */
    // Add tx to , because if it has change it's also ours,
    // otheise just for transaction history.
    CWalletTx* wtx = AddToWallet(tx, TxStateInactive{}, [&](CWalletTx& wtx, bool new_tx) {
        CHECK_NONFATAL(wtx.mapValue.empty());