diff --git a/src/page.h b/src/page.h index 082a6ec..c3cf7b3 100644 --- a/src/page.h +++ b/src/page.h @@ -5538,10 +5538,20 @@ namespace xmreg {"construction_time" , string {}}, }; + // append tx_json as in raw format to html context["tx_json_raw"] = mstch::lambda{[=](const std::string& text) -> mstch::node { return tx_json; }}; + // append additional public tx keys, if there are any, to the html context + + string add_tx_pub_keys; + + for (auto const& apk: txd.additional_pks) + add_tx_pub_keys += pod_to_hex(apk) + ";"; + + context["add_tx_pub_keys"] = add_tx_pub_keys; + string server_time_str = xmreg::timestamp_to_str_gm(server_timestamp, "%F"); mstch::array inputs = mstch::array{}; diff --git a/src/templates/partials/tx_details.html b/src/templates/partials/tx_details.html index 3f8d518..82955d2 100644 --- a/src/templates/partials/tx_details.html +++ b/src/templates/partials/tx_details.html @@ -6,6 +6,7 @@
Tx prefix hash: {{tx_prefix_hash}}
{{/enable_mixins_details}}
Tx public key: {{tx_pub_key}}
+ {{#has_payment_id}}
Payment id: {{payment_id}}
@@ -172,6 +173,10 @@ var tx_public_key = $("#tx_pub_key").text(); + var add_tx_pub_keys = $("#add_tx_pub_keys").text().split(';'); + + console.log("add_tx_pub_keys: " + add_tx_pub_keys); + var payment_id = $("#payment_id").text(); @@ -185,10 +190,13 @@ return; } - var address_decoded = decode_address(address); - - decodeOutputs(tx_json, tx_public_key, viewkey, address_decoded.spend, payment_id); - + try { + var address_decoded = decode_address(address); + decodeOutputs(tx_json, tx_public_key, viewkey, address_decoded.spend, payment_id); + } catch(err){ + console.log(err); + $("#decode-prove-results").html('

Error:' + err.message + '

' ); + } }); $("#prove_btn").click(function() { @@ -201,10 +209,13 @@ return; } - var address_decoded = decode_address(address); - - decodeOutputs(tx_json, address_decoded.view, tx_prv_key, address_decoded.spend, payment_id); - + try { + var address_decoded = decode_address(address); + decodeOutputs(tx_json, address_decoded.view, tx_prv_key, address_decoded.spend, payment_id); + } catch(err){ + console.log(err); + $("#decode-prove-results").html('

Error:' + err.message + '

' ); + } }); });