From 2f5b0fe6b669b4b0200defd9cafff83fe08e1eb0 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Thu, 19 Jan 2017 05:38:35 +0000 Subject: [PATCH] fix: decoding key image file data --- src/page.h | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/src/page.h b/src/page.h index 9008600..b28dfdf 100644 --- a/src/page.h +++ b/src/page.h @@ -2750,30 +2750,35 @@ public: // seems we found our output. so now lets decode its amount // using ringct - bool r; + if (output_source_tx.version == 2 + && !is_coinbase(output_source_tx)) + { + bool r; - r = decode_ringct(output_source_tx.rct_signatures, - tx_pub_key, - prv_view_key, - output_idx_in_tx, - output_source_tx.rct_signatures.ecdhInfo[output_idx_in_tx].mask, - rct_amount); + r = decode_ringct(output_source_tx.rct_signatures, + tx_pub_key, + prv_view_key, + output_idx_in_tx, + output_source_tx.rct_signatures.ecdhInfo[output_idx_in_tx].mask, + rct_amount); - if (!r) - { - string error_msg = fmt::format( - "Cant decode ringCT for " - "pub_tx_key: {:s} " - "using prv_view_key: {:s}", - tx_pub_key, prv_view_key); + if (!r) + { + string error_msg = fmt::format( + "Cant decode ringCT for " + "pub_tx_key: {:s} " + "using prv_view_key: {:s}", + tx_pub_key, prv_view_key); + + context["has_error"] = true; + context["error_msg"] = error_msg; - context["has_error"] = true; - context["error_msg"] = error_msg; + return mstch::render(full_page, context); + } - return mstch::render(full_page, context); - } + xmr_amount = rct_amount; - xmr_amount = rct_amount; + } // if (output_source_tx.version == 2 && !is_coinbase(output_source_tx)) break;