From 45ea707c0ca5508a9052a806b2c348168fc0557b Mon Sep 17 00:00:00 2001 From: tobtoht Date: Tue, 18 Mar 2025 10:00:17 +0100 Subject: [PATCH] getAddressSafe: check torsion --- src/libwalletqt/Wallet.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp index 4fed2adf..74451897 100644 --- a/src/libwalletqt/Wallet.cpp +++ b/src/libwalletqt/Wallet.cpp @@ -261,6 +261,16 @@ QString Wallet::getAddressSafe(quint32 accountIndex, quint32 addressIndex, bool return {}; } + if (!rct::isInMainSubgroup(rct::pk2rct(info.address.m_spend_public_key))) { + reason = "Spend public key is not is main subgroup"; + return {}; + } + + if (!rct::isInMainSubgroup(rct::pk2rct(info.address.m_view_public_key))) { + reason = "View public key is not in main subgroup"; + return {}; + } + ok = true; return QString::fromStdString(address_str); } -- 2.52.0