Skip to content

Commit

Permalink
llmq: Fix GetVerifiedContribution to return false in case of failure
Browse files Browse the repository at this point in the history
  • Loading branch information
xdustinface committed Jan 2, 2021
1 parent 9aaa230 commit 5fdfa26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/llmq/quorums_dkgsessionmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ bool CDKGSessionManager::GetVerifiedContribution(Consensus::LLMQType llmqType, c
BLSVerificationVector vvec;
BLSVerificationVectorPtr vvecPtr;
CBLSSecretKey skContribution;
if (llmqDb.Read(std::make_tuple(DB_VVEC, llmqType, pindexQuorum->GetBlockHash(), proTxHash), vvec)) {
vvecPtr = std::make_shared<BLSVerificationVector>(std::move(vvec));
if (!llmqDb.Read(std::make_tuple(DB_VVEC, llmqType, pindexQuorum->GetBlockHash(), proTxHash), vvec)) {
return false;
}
llmqDb.Read(std::make_tuple(DB_SKCONTRIB, llmqType, pindexQuorum->GetBlockHash(), proTxHash), skContribution);

vvecPtr = std::make_shared<BLSVerificationVector>(std::move(vvec));
it = contributionsCache.emplace(cacheKey, ContributionsCacheEntry{GetTimeMillis(), vvecPtr, skContribution}).first;

vvecRet = it->second.vvec;
Expand Down

0 comments on commit 5fdfa26

Please sign in to comment.