|
|
@ -216,15 +216,18 @@ int main(int ac, const char* av[]) {
|
|
|
|
|
|
|
|
|
|
|
|
CROW_ROUTE(app, "/checkandpush").methods("POST"_method)
|
|
|
|
CROW_ROUTE(app, "/checkandpush").methods("POST"_method)
|
|
|
|
([&](const crow::request& req) {
|
|
|
|
([&](const crow::request& req) {
|
|
|
|
//string rawtxdata = string(req.post().get("rawtxdata"));
|
|
|
|
|
|
|
|
crow::query_string post_data(req.body);
|
|
|
|
map<std::string, std::string> post_body = xmreg::parse_crow_post_data(req.body);
|
|
|
|
//cout << req.url_params.get("rawtxdata") << endl;
|
|
|
|
|
|
|
|
cout << req.body << endl;
|
|
|
|
if (post_body.count("rawtxdata") == 0 || post_body.count("action") == 0)
|
|
|
|
//auto j = crow::json::load(req.body);
|
|
|
|
{
|
|
|
|
//cout << req.get_header_value("rawtxdata") << endl;
|
|
|
|
return string("Raw tx data or action not provided");
|
|
|
|
//cout << j["rawtxdata"] << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return xmrblocks.show_checkandpushtx();
|
|
|
|
string raw_tx_data = post_body["rawtxdata"];
|
|
|
|
|
|
|
|
string action = post_body["action"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return xmrblocks.show_checkandpushtx(raw_tx_data, action);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
CROW_ROUTE(app, "/search").methods("GET"_method)
|
|
|
|
CROW_ROUTE(app, "/search").methods("GET"_method)
|
|
|
|