From d69be73aece5cbc5021186ead88559e665372cdb Mon Sep 17 00:00:00 2001 From: blackjok3r Date: Mon, 11 Feb 2019 17:25:51 +0800 Subject: [PATCH] Change eras activation code. Fix reindex with ac_notarypay! --- src/init.cpp | 2 ++ src/notaries_staked.cpp | 72 +++++++++-------------------------------- 2 files changed, 18 insertions(+), 56 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index 6aca3ce1b..ea8286cd0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1554,6 +1554,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) if (fReindex) { + boost::filesystem::remove(GetDataDir() / "komodostate"); + boost::filesystem::remove(GetDataDir() / "signedmasks"); pblocktree->WriteReindexing(true); //If we're reindexing in prune mode, wipe away unusable block files and all undo data files if (fPruneMode) diff --git a/src/notaries_staked.cpp b/src/notaries_staked.cpp index 6e6912256..422d0da18 100644 --- a/src/notaries_staked.cpp +++ b/src/notaries_staked.cpp @@ -70,8 +70,7 @@ int8_t StakedNotaryID(std::string ¬aryname, char *Raddress) { int8_t numStakedNotaries(uint8_t pubkeys[64][33],int8_t era) { int i; int8_t retval = 0; - static uint8_t staked_pubkeys1[64][33],staked_pubkeys2[64][33],didstaked1,didstaked2; - static uint8_t staked_pubkeys3[64][33],staked_pubkeys4[64][33],didstaked3,didstaked4; + static uint8_t staked_pubkeys[NUM_STAKED_ERAS][64][33],didinit[NUM_STAKED_ERAS]; static char ChainName[65]; if ( ChainName[0] == 0 ) @@ -82,65 +81,26 @@ int8_t numStakedNotaries(uint8_t pubkeys[64][33],int8_t era) { strcpy(ChainName,ASSETCHAINS_SYMBOL); } - if ( era != 0 ) { - switch (era) { - case 1: - if ( didstaked1 == 0 ) - { - for (i=0; i