mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
blockchain: reinstate double spending checks in check_tx_inputs
This fixes some double spending tests. This may or may not be unneeded in normal (non test) circumstances, to be determined later. Keeping these for now may be slower, but safer.
This commit is contained in:
parent
737b6d6cf5
commit
f294be35bc
1 changed files with 7 additions and 3 deletions
|
@ -2008,9 +2008,7 @@ bool Blockchain::have_tx_keyimges_as_spent(const transaction &tx) const
|
|||
return false;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
// This function validates transaction inputs and their keys. Previously
|
||||
// it also performed double spend checking, but that has been moved to its
|
||||
// own function.
|
||||
// This function validates transaction inputs and their keys.
|
||||
bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t* pmax_used_block_height)
|
||||
{
|
||||
LOG_PRINT_L3("Blockchain::" << __func__);
|
||||
|
@ -2112,6 +2110,12 @@ bool Blockchain::check_tx_inputs(const transaction& tx, uint64_t* pmax_used_bloc
|
|||
// make sure tx output has key offset(s) (is signed to be used)
|
||||
CHECK_AND_ASSERT_MES(in_to_key.key_offsets.size(), false, "empty in_to_key.key_offsets in transaction with id " << get_transaction_hash(tx));
|
||||
|
||||
if(have_tx_keyimg_as_spent(in_to_key.k_image))
|
||||
{
|
||||
LOG_PRINT_L1("Key image already spent in blockchain: " << epee::string_tools::pod_to_hex(in_to_key.k_image));
|
||||
return false;
|
||||
}
|
||||
|
||||
// basically, make sure number of inputs == number of signatures
|
||||
CHECK_AND_ASSERT_MES(sig_index < tx.signatures.size(), false, "wrong transaction: not signature entry for input with index= " << sig_index);
|
||||
|
||||
|
|
Loading…
Reference in a new issue