Different wallets may be used for different purposes.  When a notification is triggered, we get the TXID but don't know which wallet is involved.  It would be useful to have different walletnotify actions depending on which wallet is involved by the transaction.

It could be used like (bitcoin.conf):

`walletnotify.walletname=action %s`

Or maybe a more simple and flexible (dynamic-wallets compatible) way:

`walletnotify=action %s %w`

where %w is the name of the wallet.  This way, notify action (and not Bitcoin Core) is responsible for choosing the right action depending on the wallet and it is easier to RPC query the good wallet (ie gettransaction).

{
    AssertLockHeld(cs_wallet);
    CTxDestination dst;
    const CWalletTx* srctx = GetWalletTx(hash);
    if (srctx) {
        assert(srctx->tx->vout.size() > n);
        LegacyScriptPubKeyMan* spk_man = GetLegacyScriptPubKeyMan();
        
        
        assert(spk_man != nullptr);
        for (const auto& keyid : GetAffectedKeys(srctx->tx->vout[n].scriptPubKey, *spk_man)) {
            WitnessV0KeyHash wpkh_dest(keyid);
            if (GetDestData(wpkh_dest, "used", nullptr)) {
                return true;
            }
            ScriptHash sh_wpkh_dest(wpkh_dest);
            if (GetDestData(sh_wpkh_dest, "used", nullptr)) {
                return true;
            }
            PKHash pkh_dest(keyid);
            if (GetDestData(pkh_dest, "used", nullptr)) {
                return true;
            }
        }
    }
    return false;
}
bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFlushOnClose)