From d8c719dc07d682fdf9a1b0a4f1d35a41374b3700 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Fri, 20 Jan 2017 00:07:42 +0000 Subject: [PATCH] dont decode ringct amounts for ringct coinbase txs --- src/page.h | 72 ++++++++++++++++++----------------- src/templates/my_outputs.html | 2 +- 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/src/page.h b/src/page.h index 2f8238e..8f1050d 100644 --- a/src/page.h +++ b/src/page.h @@ -1283,27 +1283,28 @@ public: // if mine output has RingCT, i.e., tx version is 2 if (mine_output && tx.version == 2) { - // initialize with regular amount - uint64_t rct_amount = money_transfered[output_idx]; - - bool r; - - r = decode_ringct(tx.rct_signatures, - pub_key, - prv_view_key, - output_idx, - tx.rct_signatures.ecdhInfo[output_idx].mask, - rct_amount); - - if (!r) - { - cerr << "\nshow_my_outputs: Cant decode ringCT! " << endl; - } - // cointbase txs have amounts in plain sight. // so use amount from ringct, only for non-coinbase txs if (!is_coinbase(tx)) { + + // initialize with regular amount + uint64_t rct_amount = money_transfered[output_idx]; + + bool r; + + r = decode_ringct(tx.rct_signatures, + pub_key, + prv_view_key, + output_idx, + tx.rct_signatures.ecdhInfo[output_idx].mask, + rct_amount); + + if (!r) + { + cerr << "\nshow_my_outputs: Cant decode ringCT! " << endl; + } + outp.second = rct_amount; money_transfered[output_idx] = rct_amount; } @@ -1514,29 +1515,30 @@ public: if (mine_output && mixin_tx.version == 2) { - // initialize with regular amount - uint64_t rct_amount = amount; - - bool r; - - r = decode_ringct(mixin_tx.rct_signatures, - mixin_tx_pub_key, - prv_view_key, - output_idx_in_tx, - mixin_tx.rct_signatures.ecdhInfo[output_idx_in_tx].mask, - rct_amount); - - if (!r) - { - cerr << "show_my_outputs: key images: Cant decode ringCT!" << endl; - } - // cointbase txs have amounts in plain sight. // so use amount from ringct, only for non-coinbase txs if (!is_coinbase(mixin_tx)) { + // initialize with regular amount + uint64_t rct_amount = amount; + + bool r; + + r = decode_ringct(mixin_tx.rct_signatures, + mixin_tx_pub_key, + prv_view_key, + output_idx_in_tx, + mixin_tx.rct_signatures.ecdhInfo[output_idx_in_tx].mask, + rct_amount); + + if (!r) + { + cerr << "show_my_outputs: key images: Cant decode ringCT!" << endl; + } + amount = rct_amount; - } + + } // if (mine_output && mixin_tx.version == 2) } diff --git a/src/templates/my_outputs.html b/src/templates/my_outputs.html index 48ec321..f5ec218 100644 --- a/src/templates/my_outputs.html +++ b/src/templates/my_outputs.html @@ -75,7 +75,7 @@ {{#show_inputs}} - +

Inputs ({{inputs_no}})

{{#inputs}}