core: remove the block reward accumulation loop

This can generate non decomposed outputs for very large block
rewards (or not so large ones if a miner decides to not quantize
the block rewards). Out of an abundance of caution, we refuse
to generate those. They are still accepted by the consensus code,
however.
This commit is contained in:
moneromooo-monero 2016-04-01 21:42:19 +01:00
parent b8527668ff
commit daac1cc259
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -145,11 +145,7 @@ namespace cryptonote
[&out_amounts](uint64_t a_dust) { out_amounts.push_back(a_dust); }); [&out_amounts](uint64_t a_dust) { out_amounts.push_back(a_dust); });
CHECK_AND_ASSERT_MES(1 <= max_outs, false, "max_out must be non-zero"); CHECK_AND_ASSERT_MES(1 <= max_outs, false, "max_out must be non-zero");
while (max_outs < out_amounts.size()) CHECK_AND_ASSERT_MES(max_outs >= out_amounts.size(), false, "max_out exceeded");
{
out_amounts[out_amounts.size() - 2] += out_amounts.back();
out_amounts.resize(out_amounts.size() - 1);
}
uint64_t summary_amounts = 0; uint64_t summary_amounts = 0;
for (size_t no = 0; no < out_amounts.size(); no++) for (size_t no = 0; no < out_amounts.size(); no++)