aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-04-14 16:25:18 +0900
committerRiccardo Spagni <ric@spagni.net>2016-04-14 16:25:18 +0900
commit17049fa8e8b749c19a1f2dd46b241f7bead11a62 (patch)
treee941756f56e9ee076943500bf284924e0770c452 /src
parentMerge pull request #801 (diff)
parentcore: keep the acc loop for the genesis block (diff)
downloadmonero-17049fa8e8b749c19a1f2dd46b241f7bead11a62.tar.xz
Merge pull request #782
113cdc1 core: keep the acc loop for the genesis block (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_format_utils.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_format_utils.cpp b/src/cryptonote_core/cryptonote_format_utils.cpp
index 94f3d51d2..3b9dcc8a4 100644
--- a/src/cryptonote_core/cryptonote_format_utils.cpp
+++ b/src/cryptonote_core/cryptonote_format_utils.cpp
@@ -145,7 +145,19 @@ 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");
- CHECK_AND_ASSERT_MES(max_outs >= out_amounts.size(), false, "max_out exceeded");
+ if (height == 0)
+ {
+ // the genesis block was not decomposed, for unknown reasons
+ while (max_outs < out_amounts.size())
+ {
+ out_amounts[out_amounts.size() - 2] += out_amounts.back();
+ out_amounts.resize(out_amounts.size() - 1);
+ }
+ }
+ else
+ {
+ 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++)