mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Allow CreateTransaction to return the values of the outputs
This commit is contained in:
parent
683dd3cdbe
commit
fa413cb2a6
2 changed files with 6 additions and 2 deletions
|
|
@ -2209,7 +2209,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool ov
|
|||
}
|
||||
|
||||
bool CWallet::CreateTransaction(const vector<CRecipient>& 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<CAmount> *outAmounts)
|
||||
{
|
||||
CAmount nValue = 0;
|
||||
int nChangePosRequest = nChangePosInOut;
|
||||
|
|
@ -2463,8 +2463,12 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& 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");
|
||||
|
|
|
|||
|
|
@ -790,7 +790,7 @@ public:
|
|||
* @note passing nChangePosInOut as -1 will result in setting a random position
|
||||
*/
|
||||
bool CreateTransaction(const std::vector<CRecipient>& 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<CAmount> *outAmounts = NULL);
|
||||
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
|
||||
|
||||
bool AddAccountingEntry(const CAccountingEntry&, CWalletDB & pwalletdb);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue