mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
QT: Cache the blinded destination values on transactions we create, like -cli
This commit is contained in:
parent
5622a838c2
commit
c227c65a13
1 changed files with 4 additions and 4 deletions
|
|
@ -43,13 +43,14 @@ public:
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, m_wallet.cs_wallet);
|
LOCK2(cs_main, m_wallet.cs_wallet);
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), m_keys, g_connman.get(), state)) {
|
if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), std::move(order_form), m_keys, g_connman.get(), state, g_con_elementsmode ? &m_blind_details : nullptr)) {
|
||||||
reject_reason = state.GetRejectReason();
|
reject_reason = state.GetRejectReason();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BlindDetails m_blind_details;
|
||||||
CTransactionRef m_tx;
|
CTransactionRef m_tx;
|
||||||
CWallet& m_wallet;
|
CWallet& m_wallet;
|
||||||
std::vector<std::unique_ptr<CReserveKey>> m_keys;
|
std::vector<std::unique_ptr<CReserveKey>> m_keys;
|
||||||
|
|
@ -249,12 +250,11 @@ public:
|
||||||
pending->m_keys.emplace_back(new CReserveKey(&m_wallet));
|
pending->m_keys.emplace_back(new CReserveKey(&m_wallet));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlindDetails blind_details;
|
|
||||||
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
|
if (!m_wallet.CreateTransaction(recipients, pending->m_tx, pending->m_keys, fee, change_pos,
|
||||||
fail_reason, coin_control, sign, g_con_elementsmode ? &blind_details : nullptr)) {
|
fail_reason, coin_control, sign, g_con_elementsmode ? &pending->m_blind_details : nullptr)) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
out_amounts = blind_details.o_amounts;
|
out_amounts = pending->m_blind_details.o_amounts;
|
||||||
return std::move(pending);
|
return std::move(pending);
|
||||||
}
|
}
|
||||||
bool transactionCanBeAbandoned(const uint256& txid) override { return m_wallet.TransactionCanBeAbandoned(txid); }
|
bool transactionCanBeAbandoned(const uint256& txid) override { return m_wallet.TransactionCanBeAbandoned(txid); }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue