dont decode ringct amounts for ringct coinbase txs

master
moneroexamples 8 years ago
parent 7b3c840231
commit d8c719dc07

@ -1283,27 +1283,28 @@ public:
// if mine output has RingCT, i.e., tx version is 2 // if mine output has RingCT, i.e., tx version is 2
if (mine_output && tx.version == 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. // cointbase txs have amounts in plain sight.
// so use amount from ringct, only for non-coinbase txs // so use amount from ringct, only for non-coinbase txs
if (!is_coinbase(tx)) 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; outp.second = rct_amount;
money_transfered[output_idx] = rct_amount; money_transfered[output_idx] = rct_amount;
} }
@ -1514,29 +1515,30 @@ public:
if (mine_output && mixin_tx.version == 2) 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. // cointbase txs have amounts in plain sight.
// so use amount from ringct, only for non-coinbase txs // so use amount from ringct, only for non-coinbase txs
if (!is_coinbase(mixin_tx)) 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; amount = rct_amount;
}
} // if (mine_output && mixin_tx.version == 2)
} }

@ -75,7 +75,7 @@
</div> </div>
{{#show_inputs}} {{#show_inputs}}
<br/>
<h3>Inputs ({{inputs_no}})</h3> <h3>Inputs ({{inputs_no}})</h3>
<div class="center"> <div class="center">
{{#inputs}} {{#inputs}}

Loading…
Cancel
Save