txpool: don't drop cxns realying key images spent in chain

This commit is contained in:
j-berman
2026-09-17 18:35:09 -07:00
parent a9145f9d38
commit 439cda5f17
2 changed files with 8 additions and 3 deletions
+7 -2
View File
@@ -3499,9 +3499,14 @@ bool Blockchain::have_tx_keyimges_as_spent(const transaction &tx) const
LOG_PRINT_L3("Blockchain::" << __func__);
for (const txin_v& in: tx.vin)
{
CHECKED_GET_SPECIFIC_VARIANT(in, const txin_to_key, in_to_key, true);
if(have_tx_keyimg_as_spent(in_to_key.k_image))
if (in.type() != typeid(txin_to_key))
continue;
const auto &tokey_in = boost::get<txin_to_key>(in);
if(have_tx_keyimg_as_spent(tokey_in.k_image))
{
LOG_PRINT_L1("Key image already spent in blockchain: " << epee::string_tools::pod_to_hex(tokey_in.k_image));
return true;
}
}
return false;
}
+1 -1
View File
@@ -239,7 +239,7 @@ namespace cryptonote
// TODO: Investigate why not?
if(!kept_by_block)
{
if(have_tx_keyimges_as_spent(tx, id))
if(have_tx_keyimges_as_spent(tx, id) || m_blockchain.have_tx_keyimges_as_spent(tx))
{
mark_double_spend(tx);
LOG_PRINT_L1("Transaction with id= "<< id << " used already spent key images");