mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
QT: Fix QT to work in non-elementsmode
This commit is contained in:
parent
027aeef83e
commit
95d0981979
2 changed files with 4 additions and 3 deletions
|
|
@ -250,7 +250,7 @@ public:
|
|||
}
|
||||
BlindDetails blind_details;
|
||||
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
|
||||
fail_reason, coin_control, sign, &blind_details)) {
|
||||
fail_reason, coin_control, sign, g_con_elementsmode ? &blind_details : nullptr)) {
|
||||
return {};
|
||||
}
|
||||
out_amounts = blind_details.o_amounts;
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ void WalletModelTransaction::setTransactionFee(const CAmount& newFee)
|
|||
|
||||
void WalletModelTransaction::reassignAmounts(const std::vector<CAmount>& outAmounts, int nChangePosRet)
|
||||
{
|
||||
const CTransaction* walletTransaction = &wtx->get();
|
||||
int i = 0;
|
||||
for (auto it = recipients.begin(); it != recipients.end(); ++it)
|
||||
{
|
||||
|
|
@ -57,7 +58,7 @@ void WalletModelTransaction::reassignAmounts(const std::vector<CAmount>& outAmou
|
|||
if (out.amount() <= 0) continue;
|
||||
if (i == nChangePosRet)
|
||||
i++;
|
||||
subtotal += outAmounts[i];
|
||||
subtotal += g_con_elementsmode ? outAmounts[i] : walletTransaction->vout[i].nValue.GetAmount();
|
||||
i++;
|
||||
}
|
||||
rcp.asset_amount = subtotal;
|
||||
|
|
@ -66,7 +67,7 @@ void WalletModelTransaction::reassignAmounts(const std::vector<CAmount>& outAmou
|
|||
{
|
||||
if (i == nChangePosRet)
|
||||
i++;
|
||||
rcp.asset_amount = outAmounts[i];
|
||||
rcp.asset_amount = g_con_elementsmode ? outAmounts[i] : walletTransaction->vout[i].nValue.GetAmount();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue