From 31c6b2a901cc4016dd7d0e20d2290b1cff3b9a17 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Thu, 26 Sep 2024 14:20:24 +0200 Subject: [PATCH] wallet: can't decrypt payment id if tx key is missing --- src/wallet/wallet2.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index fa9c51bb27..f73a689e58 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -7502,6 +7502,11 @@ crypto::hash wallet2::get_payment_id(const pending_tx &ptx) const MWARNING("Encrypted payment id found, but no destinations public key, cannot decrypt"); return crypto::null_hash; } + if (ptx.tx_key == crypto::null_skey) + { + MWARNING("Encrypted payment id found, but no tx secret key, cannot decrypt"); + return crypto::null_hash; + } if (m_account.get_device().decrypt_payment_id(payment_id8, ptx.dests[0].addr.m_view_public_key, ptx.tx_key)) { memcpy(payment_id.data, payment_id8.data, 8);