test
This commit is contained in:
@@ -36,7 +36,7 @@ struct komodo_state KOMODO_STATES[34];
|
|||||||
|
|
||||||
int COINBASE_MATURITY = 100;
|
int COINBASE_MATURITY = 100;
|
||||||
|
|
||||||
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE;
|
int32_t IS_KOMODO_NOTARY,KOMODO_REWIND,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE;
|
||||||
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES;
|
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES;
|
||||||
uint8_t NOTARY_PUBKEY33[33];
|
uint8_t NOTARY_PUBKEY33[33];
|
||||||
|
|
||||||
|
|||||||
@@ -1450,6 +1450,8 @@ void komodo_args()
|
|||||||
if ( strlen(NOTARY_PUBKEY.c_str()) == 66 )
|
if ( strlen(NOTARY_PUBKEY.c_str()) == 66 )
|
||||||
USE_EXTERNAL_PUBKEY = 1;
|
USE_EXTERNAL_PUBKEY = 1;
|
||||||
name = GetArg("-ac_name","");
|
name = GetArg("-ac_name","");
|
||||||
|
if ( (KOMODO_REWIND= GetArg("-rewind",0)) != 0 )
|
||||||
|
printf("KOMODO REWIND.%d\n",KOMODO_REWIND);
|
||||||
if ( name.c_str()[0] != 0 )
|
if ( name.c_str()[0] != 0 )
|
||||||
{
|
{
|
||||||
ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10);
|
ASSETCHAINS_SUPPLY = GetArg("-ac_supply",10);
|
||||||
|
|||||||
23
src/main.cpp
23
src/main.cpp
@@ -2694,6 +2694,7 @@ static void PruneBlockIndexCandidates() {
|
|||||||
* pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork.
|
* pblock is either NULL or a pointer to a CBlock corresponding to pindexMostWork.
|
||||||
*/
|
*/
|
||||||
static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork, CBlock *pblock) {
|
static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMostWork, CBlock *pblock) {
|
||||||
|
extern int32_t KOMODO_REWIND;
|
||||||
AssertLockHeld(cs_main);
|
AssertLockHeld(cs_main);
|
||||||
bool fInvalidFound = false;
|
bool fInvalidFound = false;
|
||||||
const CBlockIndex *pindexOldTip = chainActive.Tip();
|
const CBlockIndex *pindexOldTip = chainActive.Tip();
|
||||||
@@ -2704,21 +2705,21 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
|
|||||||
if (!DisconnectTip(state))
|
if (!DisconnectTip(state))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ( 1 )
|
if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight > KOMODO_REWIND )
|
||||||
{
|
|
||||||
static int32_t didinit;
|
|
||||||
if ( didinit++ == 0 )
|
|
||||||
{
|
{
|
||||||
while (chainActive.Tip()->nHeight > 94000 )
|
static int32_t didinit;
|
||||||
|
if ( didinit++ == 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight);
|
while (chainActive.Tip()->nHeight > KOMODO_REWIND )
|
||||||
if ( !DisconnectTip(state) )
|
{
|
||||||
return false;
|
fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight);
|
||||||
|
if ( !DisconnectTip(state) )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
pindexOldTip = chainActive.Tip();
|
||||||
|
pindexFork = chainActive.FindFork(pindexMostWork);
|
||||||
}
|
}
|
||||||
pindexOldTip = chainActive.Tip();
|
|
||||||
pindexFork = chainActive.FindFork(pindexMostWork);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// Build list of new blocks to connect.
|
// Build list of new blocks to connect.
|
||||||
std::vector<CBlockIndex*> vpindexToConnect;
|
std::vector<CBlockIndex*> vpindexToConnect;
|
||||||
bool fContinue = true;
|
bool fContinue = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user