modified the interface to create transactions to remove requirement to construct and send dsts with either change or fake dst, by exposing change amount as param and uncommenting kept change addr / dsts construction - which actually solves a tx not created bug when sending to an addr (who is not oneself) with a short pid
/* This is commented because it's presently supplied by whoever is calling this function.... But there's a good argument for bringing it in, here, especially after MyMonero clients integrate with this code and soon, share an implementation of SendFunds() (the analog of create_transactions_2 + transfer_selected*)
if(change_dst.amount==0){
if(change_dts.amount==0){
if(splitted_dsts.size()==1){
if(splitted_dsts.size()==1){
// If the change is 0, send it to a random address, to avoid confusing
// If the change is 0, send it to a random address, to avoid confusing
// the sender with a 0 amount output. We send a 0 amount in order to avoid
// the sender with a 0 amount output. We send a 0 amount in order to avoid
std::vector<cryptonote::tx_destination_entry>dsts;// without change this would normally require a dummy addr with 0 amount pushed as a fake 'change' output ... that should probably be moved into the function
{// payment id
{// 0. actual destination address
cryptonote::tx_destination_entryde;
de.addr=to_addr_info.address;
de.amount=amount;
de.is_subaddress=to_addr_info.is_subaddress;
if(to_addr_info.is_subaddress&&payment_id_seen){
if(to_addr_info.is_subaddress&&payment_id_seen){
BOOST_REQUIRE_MESSAGE(false,"Illegal: Never supply a pid with a subaddress.");// TODO: is this true?
BOOST_REQUIRE_MESSAGE(false,"Illegal: Never supply a pid with a subaddress.");// TODO: is this true?