What changed, and why it matters
This change adds a new read-only flag to Monero wallet transaction records that tells users whether an incoming unconfirmed payment has been seen in a suspected double-spend attempt. It does not change how transactions are validated or accepted by the network; it only exposes information that was already tracked internally so wallet interfaces can display a warning. There is no direct security fix here, but it helps wallet users avoid trusting a payment that might later disappear from the blockchain.
No immediate action required. Treat this as a minor informational API improvement. Downstream wallet GUI/CLI users may consider surfacing the new isDoubleSpendSeen() indicator to warn users about risky unconfirmed incoming payments.
Security signals we found
new public API exposes pre-existing internal double-spend indicator
no change to consensus, validation, or mempool rules
no memory safety, cryptographic, or authorization changes
no bug fix or vulnerability patch evident in diff
Evidence from the diff
The commit extends the wallet_api TransactionInfo interface with an isDoubleSpendSeen() accessor and populates m_double_spend_seen from the existing pool payment double_spend_seen field for unconfirmed incoming payments. For other transaction types (confirmed transfers, unconfirmed transfers, payment details) the flag is set to false because the underlying data structures do not carry that field. This is a pure API/visibility change in src/wallet/api; consensus, cryptonote core, and mempool acceptance logic are untouched.
Changed components
src/wallet/api/transaction_history.cppsrc/wallet/api/transaction_info.cppsrc/wallet/api/transaction_info.hsrc/wallet/api/wallet2_api.hInspect captured patch +17 / −0
### src/wallet/api/transaction_history.cpp
@@ -151,6 +151,8 @@ void TransactionHistoryImpl::refresh()
ti->m_timestamp = pd.m_timestamp;
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
ti->m_unlock_time = pd.m_unlock_time;
+ // not used for payment_details
+ ti->m_double_spend_seen = false;
m_history.push_back(ti);
}
@@ -194,6 +196,8 @@ void TransactionHistoryImpl::refresh()
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
ti->m_timestamp = pd.m_timestamp;
ti->m_confirmations = (wallet_height > pd.m_block_height) ? wallet_height - pd.m_block_height : 0;
+ // not used for confirmed_transfer_details
+ ti->m_double_spend_seen = false;
// single output transaction might contain multiple transfers
for (const auto &d: pd.m_dests) {
@@ -230,6 +234,8 @@ void TransactionHistoryImpl::refresh()
ti->m_label = pd.m_subaddr_indices.size() == 1 ? m_wallet->m_wallet->get_subaddress_label({pd.m_subaddr_account, *pd.m_subaddr_indices.begin()}) : "";
ti->m_timestamp = pd.m_timestamp;
ti->m_confirmations = 0;
+ // not used for unconfirmed_transfer_details
+ ti->m_double_spend_seen = false;
for (const auto &d : pd.m_dests)
{
ti->m_transfers.push_back({d.amount, d.address(m_wallet->m_wallet->nettype(), pd.m_payment_id)});
@@ -259,6 +265,7 @@ void TransactionHistoryImpl::refresh()
ti->m_label = m_wallet->m_wallet->get_subaddress_label(pd.m_subaddr_index);
ti->m_timestamp = pd.m_timestamp;
ti->m_confirmations = 0;
+ ti->m_double_spend_seen = i->second.m_double_spend_seen;
m_history.push_back(ti);
LOG_PRINT_L1(__FUNCTION__ << ": Unconfirmed payment found " << pd.m_amount);
### src/wallet/api/transaction_info.cpp
@@ -149,4 +149,9 @@ uint64_t TransactionInfoImpl::unlockTime() const
return m_unlock_time;
}
+bool TransactionInfoImpl::isDoubleSpendSeen() const
+{
+ return m_double_spend_seen;
+}
+
} // namespace
### src/wallet/api/transaction_info.h
@@ -63,6 +63,8 @@ class TransactionInfoImpl : public TransactionInfo
virtual uint64_t confirmations() const override;
virtual uint64_t unlockTime() const override;
+ bool isDoubleSpendSeen() const override;
+
private:
int m_direction;
bool m_pending;
@@ -81,6 +83,8 @@ class TransactionInfoImpl : public TransactionInfo
std::vector<Transfer> m_transfers;
uint64_t m_confirmations;
uint64_t m_unlock_time;
+ // is double spend seen
+ bool m_double_spend_seen;
friend class TransactionHistoryImpl;
### src/wallet/api/wallet2_api.h
@@ -192,6 +192,7 @@ struct TransactionInfo
virtual std::string paymentId() const = 0;
//! only applicable for output transactions
virtual const std::vector<Transfer> & transfers() const = 0;
+ virtual bool isDoubleSpendSeen() const = 0;
};
/**
* @brief The TransactionHistory - interface for displaying transaction historyWhy this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.