From 5874c7c92f34303216bd1123404253df6e623423 Mon Sep 17 00:00:00 2001 From: alex v Date: Tue, 2 Mar 2021 21:04:12 +0100 Subject: [PATCH] fix #807 --- src/blsct/aggregationsession.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/src/blsct/aggregationsession.cpp b/src/blsct/aggregationsession.cpp index ada0cb97e..9b8edd3e3 100644 --- a/src/blsct/aggregationsession.cpp +++ b/src/blsct/aggregationsession.cpp @@ -135,7 +135,7 @@ bool AggregationSession::CleanCandidateTransactions() { { AssertLockHeld(cs_aggregation); - + set seenInputs; vTransactionCandidates.erase(std::remove_if(vTransactionCandidates.begin(), vTransactionCandidates.end(), [=, &seenInputs](CandidateTransaction x) { @@ -143,7 +143,7 @@ bool AggregationSession::CleanCandidateTransactions() { return true; } - + for (int i = 0; i < x.tx.vin.size(); i++) { CTxIn in = x.tx.vin[i]; @@ -464,25 +464,18 @@ bool AggregationSession::BuildCandidateTransaction(const CWalletTx *prevcoin, co candidate.nVersion = TX_BLS_INPUT_FLAG | TX_BLS_CT_FLAG; blsctDoublePublicKey k; - blsctPublicKey pk; blsctKey bk, v, s; - std::vector> reserveBLSCTKey; - shared_ptr rk(new CReserveBLSCTBlindingKey(pwalletMain)); - reserveBLSCTKey.insert(reserveBLSCTKey.begin(), std::move(rk)); - - reserveBLSCTKey[0]->GetReservedKey(pk); + std::vector rand; + rand.resize(32); + GetRandBytes(rand.data(), 32); + bk = bls::AugSchemeMPL::KeyGen(rand); std::vector ephemeralKey; { LOCK(pwalletMain->cs_wallet); - if (!pwalletMain->GetBLSCTBlindingKey(pk, bk)) - { - return error("AggregationSession::%s: Could not get private key from blsct pool",__func__); - } - ephemeralKey = bk.GetKey().Serialize(); if (!pwalletMain->GetBLSCTSubAddressPublicKeys(prevcoin->vout[prevout].outputKey, prevcoin->vout[prevout].spendingKey, k))