Skip to content

Commit

Permalink
Fix one more minor bug in spark spend verification
Browse files Browse the repository at this point in the history
  • Loading branch information
levonpetrosyan93 committed Jun 5, 2023
1 parent 33d6d5c commit e946fce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/spark/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,9 @@ bool CheckSparkSpendTransaction(
while (index != coinGroup.firstBlock && index->GetBlockHash() != idAndHash.second)
index = index->pprev;

// take the hash from last block of anonymity set
std::vector<unsigned char> set_hash = GetAnonymitySetHash(index, idAndHash.first);

std::vector<Coin> cover_set;
// Build a vector with all the public coins with given id before
// the block on which the spend occurred.
Expand All @@ -664,8 +667,6 @@ bool CheckSparkSpendTransaction(
index = index->pprev;
}

// take the hash from last block of anonymity set
std::vector<unsigned char> set_hash = GetAnonymitySetHash(coinGroup.lastBlock, idAndHash.first);
CoverSetData setData;
setData.cover_set = cover_set;
if (!set_hash.empty())
Expand Down

0 comments on commit e946fce

Please sign in to comment.