mirror of
https://github.com/wownero/wownero.git
synced 2026-11-13 03:43:54 +01:00
txpool: don't drop cxns realying key images spent in chain
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user