diff --git a/main.cpp b/main.cpp index d3ff1e5..cb55bfc 100644 --- a/main.cpp +++ b/main.cpp @@ -100,8 +100,16 @@ int main(int ac, const char* av[]) { return xmrblocks.show_tx(tx_hash, with_ring_signatures); }); - CROW_ROUTE(app, "/myoutputs///") - ([&](string tx_hash, string xmr_address, string viewkey) { +// CROW_ROUTE(app, "/myoutputs///") +// ([&](string tx_hash, string xmr_address, string viewkey) { +// return xmrblocks.show_my_outputs(tx_hash, xmr_address, viewkey); +// }); + + CROW_ROUTE(app, "/myoutputs").methods("GET"_method) + ([&](const crow::request& req) { + string tx_hash = string(req.url_params.get("tx_hash")); + string xmr_address = string(req.url_params.get("xmr_address")); + string viewkey = string(req.url_params.get("viewkey")); return xmrblocks.show_my_outputs(tx_hash, xmr_address, viewkey); }); diff --git a/src/page.h b/src/page.h index 3d2e188..33a251c 100644 --- a/src/page.h +++ b/src/page.h @@ -1101,6 +1101,26 @@ namespace xmreg { show_my_outputs(string tx_hash_str, string xmr_address_str, string viewkey_str) { + // remove white characters + boost::trim(tx_hash_str); + boost::trim(xmr_address_str); + boost::trim(viewkey_str); + + if (tx_hash_str.empty()) + { + return string("tx hash not provided!"); + } + + if (xmr_address_str.empty()) + { + return string("Monero address not provided!"); + } + + if (viewkey_str.empty()) + { + return string("Viewkey not provided!"); + } + // parse tx hash string to hash object crypto::hash tx_hash; diff --git a/src/templates/tx.html b/src/templates/tx.html index 60183a7..11e82d6 100644 --- a/src/templates/tx.html +++ b/src/templates/tx.html @@ -56,6 +56,15 @@ +

Check which of the above outputs belong to the provided address and viewkey

+ +
+
+
+
+ +
+ {{#has_inputs}}

Inputs' mixins time scale (from genesis till {{server_time}};