diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 51d28cc0ee..f1f179fdf1 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2209,7 +2209,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool ov } bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, - int& nChangePosInOut, std::string& strFailReason, const CCoinControl* coinControl, bool sign) + int& nChangePosInOut, std::string& strFailReason, const CCoinControl* coinControl, bool sign, std::vector *outAmounts) { CAmount nValue = 0; int nChangePosRequest = nChangePosInOut; @@ -2463,8 +2463,12 @@ bool CWallet::CreateTransaction(const vector& vecSend, CWalletTx& wt uint256 blind = coin.first->GetBlindingFactor(coin.second); input_blinds.push_back(blind); } + if(outAmounts) + outAmounts->clear(); for (size_t nOut = 0; nOut < txNew.vout.size(); nOut++) { output_blinds.push_back(uint256()); + if (outAmounts) + outAmounts->push_back(txNew.vout[nOut].nValue.GetAmount()); } if (fBlindedIns && !fBlindedOuts) { strFailReason = _("Confidential inputs without confidential outputs"); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index b5b86d6fc7..861ded559f 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -790,7 +790,7 @@ public: * @note passing nChangePosInOut as -1 will result in setting a random position */ bool CreateTransaction(const std::vector& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosInOut, - std::string& strFailReason, const CCoinControl *coinControl = NULL, bool sign = true); + std::string& strFailReason, const CCoinControl *coinControl = NULL, bool sign = true, std::vector *outAmounts = NULL); bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey); bool AddAccountingEntry(const CAccountingEntry&, CWalletDB & pwalletdb);