dest_infos added to signed tx details

master
moneroexamples 8 years ago
parent c193e8adeb
commit 98e4f45748

@ -1603,15 +1603,24 @@ namespace xmreg {
return boost::get<string>(tx_context["error_msg"]); return boost::get<string>(tx_context["error_msg"]);
} }
vector<uint64_t> address_amounts; mstch::array destination_addresses;
// get amounts for stealth addresses // destiantion address for this tx
for (tx_destination_entry& dest: ptx.construction_data.destinations) for (tx_destination_entry& a_dest: ptx.construction_data.destinations)
{ {
//stealth_address_amount.insert({dest.addr, dest.amount}); //stealth_address_amount.insert({dest.addr, dest.amount});
//cout << pod_to_hex(dest.addr) << endl; cout << get_account_address_as_str(testnet, a_dest.addr) << endl;
address_amounts.push_back(dest.amount); //address_amounts.push_back(a_dest.amount);
destination_addresses.push_back(
mstch::map {
{"dest_address", get_account_address_as_str(testnet, a_dest.addr)},
{"dest_amount" , fmt::format("{:0.12f}", XMR_AMOUNT(a_dest.amount))}
} }
);
}
tx_context.insert({"dest_infos", destination_addresses});
// get reference to inputs array created of the tx // get reference to inputs array created of the tx
mstch::array& outputs = boost::get<mstch::array>(tx_context["outputs"]); mstch::array& outputs = boost::get<mstch::array>(tx_context["outputs"]);
@ -1622,7 +1631,7 @@ namespace xmreg {
mstch::map& output_map = boost::get<mstch::map>(outputs.at(i)); mstch::map& output_map = boost::get<mstch::map>(outputs.at(i));
//cout << boost::get<string>(output_map["out_pub_key"]) <<", " << address_amounts.at(i) << endl; //cout << boost::get<string>(output_map["out_pub_key"]) <<", " << address_amounts.at(i) << endl;
cout << boost::get<string>(output_map["out_pub_key"]) << endl; //cout << boost::get<string>(output_map["out_pub_key"]) << endl;
} }
// get public keys of real outputs // get public keys of real outputs
@ -1716,7 +1725,6 @@ namespace xmreg {
if (epee::string_tools::hex_to_pod(in_key_img_str, key_imgage)) if (epee::string_tools::hex_to_pod(in_key_img_str, key_imgage))
{ {
input_map["already_spent"] = core_storage->get_db().has_key_image(key_imgage); input_map["already_spent"] = core_storage->get_db().has_key_image(key_imgage);
} }

@ -90,8 +90,12 @@
{{^unsigned_tx_given}} {{^unsigned_tx_given}}
<h3>Details of signed raw tx data given</h3> <h3>Details of signed raw tx data given</h3>
{{#txs}} {{#txs}}
<h5>
{{#dest_infos}}
Send {{dest_amount}} to {{dest_address}}<br/>
{{/dest_infos}}
</h5>
{{>tx_details}} {{>tx_details}}
{{/txs}} {{/txs}}

Loading…
Cancel
Save