Fix spend tracking bug in db::storage (#89)

This commit is contained in:
Lee *!* Clagett
2023-12-03 15:47:04 -05:00
committed by Lee *!* Clagett
parent 9446758fdb
commit 9f98d2a8c9
2 changed files with 8 additions and 2 deletions

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{