fixed bug when sending to subaddrs - cryptonote_tx_utils takes a list of tx_destination_entrys which it assumes have got their is_subaddr flags set correctly - and the flag that the to-address is a subaddress didn't get ported from cn_utils construct/create tx because we didn't need to do it in core-js to add subaddr support there – given that in core-js we modified the pub key for subaddr sending by directly detecting whether the dst addr is a subaddr – a difference from cryptonote_tx_utils. funds that were sent using the faulty subaddr support are not lost and are recoverable because only the tx pub key of the txs was incorrectly written - if the correct tx pub key is generated and use for that tx then funds can be scanned and sent from the correct receiving wallet - mymonero-app-js#237

pull/29/head
Paul Shapiro 6 years ago
parent a9daf4cef9
commit 617659c707

@ -435,7 +435,7 @@ void monero_transfer_utils::create_transaction(
const account_keys& sender_account_keys, // this will reference a particular hw::device
const uint32_t subaddr_account_idx,
const std::unordered_map<crypto::public_key, cryptonote::subaddress_index> &subaddresses,
const account_public_address &to_addr,
const address_parse_info &to_addr,
uint64_t sending_amount,
uint64_t change_amount,
uint64_t fee_amount,
@ -609,8 +609,9 @@ void monero_transfer_utils::create_transaction(
// TODO: if this is a multisig wallet, create a list of multisig signers we can use
std::vector<cryptonote::tx_destination_entry> splitted_dsts;
tx_destination_entry to_dst = AUTO_VAL_INIT(to_dst);
to_dst.addr = to_addr;
to_dst.addr = to_addr.address;
to_dst.amount = sending_amount;
to_dst.is_subaddress = to_addr.is_subaddress;
splitted_dsts.push_back(to_dst);
//
cryptonote::tx_destination_entry change_dst = AUTO_VAL_INIT(change_dst);
@ -756,7 +757,7 @@ void monero_transfer_utils::convenience__create_transaction(
create_transaction(
actualCall_retVals,
account_keys, subaddr_account_idx, subaddresses,
to_addr_info.address,
to_addr_info,
sending_amount, change_amount, fee_amount,
outputs, mix_outs,
extra, // TODO: move to after address

@ -270,7 +270,7 @@ namespace monero_transfer_utils
const account_keys& sender_account_keys, // this will reference a particular hw::device
const uint32_t subaddr_account_idx, // pass 0 for no subaddrs
const std::unordered_map<crypto::public_key, cryptonote::subaddress_index> &subaddresses,
const account_public_address &to_addr,
const address_parse_info &to_addr, // this _must_ include correct .is_subaddr
uint64_t sending_amount,
uint64_t change_amount,
uint64_t fee_amount,

Loading…
Cancel
Save