From e946fceae15d72fcf50c9dc7d4ee53ff82da53a9 Mon Sep 17 00:00:00 2001 From: levonpetrosyan93 Date: Mon, 5 Jun 2023 05:46:06 +0400 Subject: [PATCH] Fix one more minor bug in spark spend verification --- src/spark/state.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/spark/state.cpp b/src/spark/state.cpp index b25c553595..40bbcf8445 100644 --- a/src/spark/state.cpp +++ b/src/spark/state.cpp @@ -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 set_hash = GetAnonymitySetHash(index, idAndHash.first); + std::vector cover_set; // Build a vector with all the public coins with given id before // the block on which the spend occurred. @@ -664,8 +667,6 @@ bool CheckSparkSpendTransaction( index = index->pprev; } - // take the hash from last block of anonymity set - std::vector set_hash = GetAnonymitySetHash(coinGroup.lastBlock, idAndHash.first); CoverSetData setData; setData.cover_set = cover_set; if (!set_hash.empty())