forked from lthn/blockchain
wallet: prepare_tx_sources() fixed for post-HF4 transfers
This commit is contained in:
parent
068d606557
commit
741aae9b7f
1 changed files with 4 additions and 3 deletions
|
|
@ -4830,15 +4830,16 @@ bool wallet2::prepare_tx_sources(size_t fake_outputs_count, std::vector<currency
|
||||||
if (fake_outputs_count)
|
if (fake_outputs_count)
|
||||||
{
|
{
|
||||||
COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request req = AUTO_VAL_INIT(req);
|
COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request req = AUTO_VAL_INIT(req);
|
||||||
req.use_forced_mix_outs = false; //add this feature to UI later
|
req.height_upper_limit = m_last_pow_block_h; // request decoys to be either older than, or the same age as stake output's height
|
||||||
req.decoys_count = fake_outputs_count + 1;// add one to make possible (if need) to skip real output key
|
req.use_forced_mix_outs = false; // TODO: add this feature to UI later
|
||||||
|
req.decoys_count = fake_outputs_count + 1; // one more to be able to skip a decoy in case it hits the real output
|
||||||
for (uint64_t i: selected_indicies)
|
for (uint64_t i: selected_indicies)
|
||||||
{
|
{
|
||||||
auto it = m_transfers.begin() + i;
|
auto it = m_transfers.begin() + i;
|
||||||
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(it->m_ptx_wallet_info->m_tx.vout.size() > it->m_internal_output_index,
|
WLT_THROW_IF_FALSE_WALLET_INT_ERR_EX(it->m_ptx_wallet_info->m_tx.vout.size() > it->m_internal_output_index,
|
||||||
"m_internal_output_index = " << it->m_internal_output_index <<
|
"m_internal_output_index = " << it->m_internal_output_index <<
|
||||||
" is greater or equal to outputs count = " << it->m_ptx_wallet_info->m_tx.vout.size());
|
" is greater or equal to outputs count = " << it->m_ptx_wallet_info->m_tx.vout.size());
|
||||||
req.amounts.push_back(it->amount());
|
req.amounts.push_back(it->is_zc() ? 0 : it->m_amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool r = m_core_proxy->call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(req, daemon_resp);
|
bool r = m_core_proxy->call_COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS(req, daemon_resp);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue