|
|
@ -4788,11 +4788,10 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, const std::string &signed_f
|
|
|
|
LOG_PRINT_L1(" " << (n+1) << ": " << sd.sources.size() << " inputs, ring size " << sd.sources[0].outputs.size());
|
|
|
|
LOG_PRINT_L1(" " << (n+1) << ": " << sd.sources.size() << " inputs, ring size " << sd.sources[0].outputs.size());
|
|
|
|
signed_txes.ptx.push_back(pending_tx());
|
|
|
|
signed_txes.ptx.push_back(pending_tx());
|
|
|
|
tools::wallet2::pending_tx &ptx = signed_txes.ptx.back();
|
|
|
|
tools::wallet2::pending_tx &ptx = signed_txes.ptx.back();
|
|
|
|
bool bulletproof = sd.use_rct && !ptx.tx.rct_signatures.p.bulletproofs.empty();
|
|
|
|
|
|
|
|
crypto::secret_key tx_key;
|
|
|
|
crypto::secret_key tx_key;
|
|
|
|
std::vector<crypto::secret_key> additional_tx_keys;
|
|
|
|
std::vector<crypto::secret_key> additional_tx_keys;
|
|
|
|
rct::multisig_out msout;
|
|
|
|
rct::multisig_out msout;
|
|
|
|
bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), m_subaddresses, sd.sources, sd.splitted_dsts, sd.change_dts.addr, sd.extra, ptx.tx, sd.unlock_time, tx_key, additional_tx_keys, sd.use_rct, bulletproof, m_multisig ? &msout : NULL);
|
|
|
|
bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), m_subaddresses, sd.sources, sd.splitted_dsts, sd.change_dts.addr, sd.extra, ptx.tx, sd.unlock_time, tx_key, additional_tx_keys, sd.use_rct, sd.use_bulletproofs, m_multisig ? &msout : NULL);
|
|
|
|
THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sd.sources, sd.splitted_dsts, sd.unlock_time, m_nettype);
|
|
|
|
THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sd.sources, sd.splitted_dsts, sd.unlock_time, m_nettype);
|
|
|
|
// we don't test tx size, because we don't know the current limit, due to not having a blockchain,
|
|
|
|
// we don't test tx size, because we don't know the current limit, due to not having a blockchain,
|
|
|
|
// and it's a bit pointless to fail there anyway, since it'd be a (good) guess only. We sign anyway,
|
|
|
|
// and it's a bit pointless to fail there anyway, since it'd be a (good) guess only. We sign anyway,
|
|
|
@ -5168,8 +5167,7 @@ bool wallet2::sign_multisig_tx(multisig_tx_set &exported_txs, std::vector<crypto
|
|
|
|
cryptonote::transaction tx;
|
|
|
|
cryptonote::transaction tx;
|
|
|
|
rct::multisig_out msout = ptx.multisig_sigs.front().msout;
|
|
|
|
rct::multisig_out msout = ptx.multisig_sigs.front().msout;
|
|
|
|
auto sources = sd.sources;
|
|
|
|
auto sources = sd.sources;
|
|
|
|
const bool bulletproof = sd.use_rct && (ptx.tx.rct_signatures.type == rct::RCTTypeFullBulletproof || ptx.tx.rct_signatures.type == rct::RCTTypeSimpleBulletproof);
|
|
|
|
bool r = cryptonote::construct_tx_with_tx_key(m_account.get_keys(), m_subaddresses, sources, sd.splitted_dsts, ptx.change_dts.addr, sd.extra, tx, sd.unlock_time, ptx.tx_key, ptx.additional_tx_keys, sd.use_rct, sd.use_bulletproofs, &msout, false);
|
|
|
|
bool r = cryptonote::construct_tx_with_tx_key(m_account.get_keys(), m_subaddresses, sources, sd.splitted_dsts, ptx.change_dts.addr, sd.extra, tx, sd.unlock_time, ptx.tx_key, ptx.additional_tx_keys, sd.use_rct, bulletproof, &msout, false);
|
|
|
|
|
|
|
|
THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sd.sources, sd.splitted_dsts, sd.unlock_time, m_nettype);
|
|
|
|
THROW_WALLET_EXCEPTION_IF(!r, error::tx_not_constructed, sd.sources, sd.splitted_dsts, sd.unlock_time, m_nettype);
|
|
|
|
|
|
|
|
|
|
|
|
THROW_WALLET_EXCEPTION_IF(get_transaction_prefix_hash (tx) != get_transaction_prefix_hash(ptx.tx),
|
|
|
|
THROW_WALLET_EXCEPTION_IF(get_transaction_prefix_hash (tx) != get_transaction_prefix_hash(ptx.tx),
|
|
|
@ -6472,6 +6470,7 @@ void wallet2::transfer_selected(const std::vector<cryptonote::tx_destination_ent
|
|
|
|
ptx.construction_data.extra = tx.extra;
|
|
|
|
ptx.construction_data.extra = tx.extra;
|
|
|
|
ptx.construction_data.unlock_time = unlock_time;
|
|
|
|
ptx.construction_data.unlock_time = unlock_time;
|
|
|
|
ptx.construction_data.use_rct = false;
|
|
|
|
ptx.construction_data.use_rct = false;
|
|
|
|
|
|
|
|
ptx.construction_data.use_bulletproofs = false;
|
|
|
|
ptx.construction_data.dests = dsts;
|
|
|
|
ptx.construction_data.dests = dsts;
|
|
|
|
// record which subaddress indices are being used as inputs
|
|
|
|
// record which subaddress indices are being used as inputs
|
|
|
|
ptx.construction_data.subaddr_account = subaddr_account;
|
|
|
|
ptx.construction_data.subaddr_account = subaddr_account;
|
|
|
@ -6727,6 +6726,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
|
|
|
|
ptx.construction_data.extra = tx.extra;
|
|
|
|
ptx.construction_data.extra = tx.extra;
|
|
|
|
ptx.construction_data.unlock_time = unlock_time;
|
|
|
|
ptx.construction_data.unlock_time = unlock_time;
|
|
|
|
ptx.construction_data.use_rct = true;
|
|
|
|
ptx.construction_data.use_rct = true;
|
|
|
|
|
|
|
|
ptx.construction_data.use_bulletproofs = !tx.rct_signatures.p.bulletproofs.empty();
|
|
|
|
ptx.construction_data.dests = dsts;
|
|
|
|
ptx.construction_data.dests = dsts;
|
|
|
|
// record which subaddress indices are being used as inputs
|
|
|
|
// record which subaddress indices are being used as inputs
|
|
|
|
ptx.construction_data.subaddr_account = subaddr_account;
|
|
|
|
ptx.construction_data.subaddr_account = subaddr_account;
|
|
|
|