Fix spend tracking bug in db::storage

This commit is contained in:
Lee Clagett 2023-12-03 13:18:56 -05:00
parent 037c5386dc
commit 45b39b3bcf

View file

@ -219,7 +219,13 @@ namespace db
right_bytes.remove_prefix(sizeof(crypto::hash));
static_assert(sizeof(crypto::key_image) == 32, "bad memcmp below");
return compare_32bytes(left_bytes, right_bytes);
diff = compare_32bytes(left_bytes, right_bytes);
if (diff)
return diff;
left_bytes.remove_prefix(sizeof(crypto::key_image));
right_bytes.remove_prefix(sizeof(crypto::key_image));
return less<output_id>(left_bytes, right_bytes);
}
constexpr const lmdb::basic_table<unsigned, block_info> blocks{