Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ bool CPrivateSendClient::PrepareDenominate(int nMinRounds, int nMaxRounds, std::
vecTxDSIn.erase(it);
vCoins.erase(it2);

CScript scriptDenom = keyHolderStorage.AddKey(pwalletMain).GetScriptForDestination();
CScript scriptDenom = keyHolderStorage.AddKey(pwalletMain);

// add new output
CTxOut txout(nValueDenom, scriptDenom);
Expand Down Expand Up @@ -1272,7 +1272,7 @@ bool CPrivateSendClient::CreateDenominated(const CompactTallyItem& tallyItem, bo
// ****** Add an output for mixing collaterals ************ /

if(fCreateMixingCollaterals) {
CScript scriptCollateral = keyHolderStorageDenom.AddKey(pwalletMain).GetScriptForDestination();
CScript scriptCollateral = keyHolderStorageDenom.AddKey(pwalletMain);
vecSend.push_back((CRecipient){ scriptCollateral, CPrivateSend::GetMaxCollateralAmount(), false });
nValueLeft -= CPrivateSend::GetMaxCollateralAmount();
}
Expand Down Expand Up @@ -1307,7 +1307,7 @@ bool CPrivateSendClient::CreateDenominated(const CompactTallyItem& tallyItem, bo

// add each output up to 11 times until it can't be added again
while(nValueLeft - nDenomValue >= 0 && nOutputs <= 10) {
CScript scriptDenom = keyHolderStorageDenom.AddKey(pwalletMain).GetScriptForDestination();
CScript scriptDenom = keyHolderStorageDenom.AddKey(pwalletMain);

vecSend.push_back((CRecipient){ scriptDenom, nDenomValue, false });

Expand Down
4 changes: 2 additions & 2 deletions src/privatesend-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ CScript CKeyHolder::GetScriptForDestination() const
}


const CKeyHolder& CKeyHolderStorage::AddKey(CWallet* pwallet)
CScript CKeyHolderStorage::AddKey(CWallet* pwallet)
{
LOCK(cs_storage);
storage.emplace_back(std::unique_ptr<CKeyHolder>(new CKeyHolder(pwallet)));
LogPrintf("CKeyHolderStorage::%s -- storage size %lld\n", __func__, storage.size());
return *storage.back();
return storage.back()->GetScriptForDestination();
}

void CKeyHolderStorage::KeepAll(){
Expand Down
2 changes: 1 addition & 1 deletion src/privatesend-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CKeyHolderStorage
mutable CCriticalSection cs_storage;

public:
const CKeyHolder& AddKey(CWallet* pwalletIn);
CScript AddKey(CWallet* pwalletIn);
void KeepAll();
void ReturnAll();

Expand Down