diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-01 21:42:19 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-04-01 21:42:19 +0100 |
| commit | daac1cc259f79e13a02a8f4a28db628ff258d9fe (patch) | |
| tree | 37b9886118f8cca4bd38d486a82857a8f6a55973 | |
| parent | b8527668ffbcc4c95fe33e2ea163f07f25af5fcb (diff) | |
| download | monzero-core-daac1cc259f79e13a02a8f4a28db628ff258d9fe.tar.gz monzero-core-daac1cc259f79e13a02a8f4a28db628ff258d9fe.tar.xz monzero-core-daac1cc259f79e13a02a8f4a28db628ff258d9fe.zip | |
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.
| -rw-r--r-- | src/cryptonote_core/cryptonote_format_utils.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp index 3c1acd8a9..94f3d51d2 100644 --- a/src/cryptonote_core/cryptonote_format_utils.cpp +++ b/src/cryptonote_core/cryptonote_format_utils.cpp @@ -145,11 +145,7 @@ namespace cryptonote [&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"); - while (max_outs < out_amounts.size()) - { - out_amounts[out_amounts.size() - 2] += out_amounts.back(); - out_amounts.resize(out_amounts.size() - 1); - } + CHECK_AND_ASSERT_MES(max_outs >= out_amounts.size(), false, "max_out exceeded"); uint64_t summary_amounts = 0; for (size_t no = 0; no < out_amounts.size(); no++) |
