Skip to content

Commit

Permalink
correct type mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ohcee committed Jul 29, 2024
1 parent 0e5d01e commit 27b5133
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
#define MICRO 0.000001
#define MILLI 0.001

// Caches for zerocoin items
std::map<uint256, uint256> cacheSpends;
std::map<uint256, uint256> cacheMints;
// Cache definitions
std::map<libzerocoin::CoinSpend, uint256> cacheSpends;
std::map<libzerocoin::PublicCoin, uint256> cacheMints;
std::map<uint256, uint256> cacheSpentPubcoins;

bool FlushCacheToDatabase(const CBlockIndex* pindex, CValidationState& state) {
Expand All @@ -100,7 +100,7 @@ bool FlushCacheToDatabase(const CBlockIndex* pindex, CValidationState& state) {
return true;
}

bool CacheAndFlushZerocoinData(CValidationState& state, const CBlockIndex* pindex, const std::map<uint256, uint256>& mapSpends, const std::map<uint256, uint256>& mapMints, const std::map<uint256, uint256>& mapSpentPubcoinsInBlock) {
bool CacheAndFlushZerocoinData(CValidationState& state, const CBlockIndex* pindex, const std::map<libzerocoin::CoinSpend, uint256>& mapSpends, const std::map<libzerocoin::PublicCoin, uint256>& mapMints, const std::map<uint256, uint256>& mapSpentPubcoinsInBlock) {
// Add items to cache
cacheSpends.insert(mapSpends.begin(), mapSpends.end());
cacheMints.insert(mapMints.begin(), mapMints.end());
Expand Down Expand Up @@ -2948,7 +2948,8 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl

// Add items to cache and flush if necessary
if (!CacheAndFlushZerocoinData(state, pindex, mapSpends, mapMints, mapSpentPubcoinsInBlock))
return state.Error("Failed to process zerocoin");
return state.Error("Failed to process zerocoin");


int64_t nTime6 = GetTimeMicros(); nTimeDatabaseZerocoin += nTime6 - nTime5;
LogPrint(BCLog::BENCH, " - Writing zerocoin to database : %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime6 - nTime5), nTimeDatabaseZerocoin * MICRO, nTimeDatabaseZerocoin * MILLI / nBlocksTotal);
Expand Down

0 comments on commit 27b5133

Please sign in to comment.