This commit is contained in:
jl777
2017-03-24 03:22:43 +02:00
parent aa8eaec46f
commit d8be8b2ef7
5 changed files with 16 additions and 40 deletions

View File

@@ -1246,26 +1246,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
LogPrintf("Prune: pruned datadir may not have more than %d blocks; -checkblocks=%d may fail\n",
MIN_BLOCKS_TO_KEEP, GetArg("-checkblocks", 288));
}
uint256 hash(uint256S("0000005213c9cea80d42aae6e917487485d0b197a83ffbc0bcd0aef6e38c6ded"));
uint256 hash2(uint256S("05a8cd56e2118713ed5931300868fbcd96f573c5051b3568f053658b2a5a1115"));
CValidationState state;
if ( 0 )
{
LOCK(cs_main);
if ( mapBlockIndex.count(hash) != 0 )
{
CBlockIndex* pblockindex;
if ( (pblockindex= mapBlockIndex[hash]) != 0 )
InvalidateBlock(state, pblockindex);
}
if ( mapBlockIndex.count(hash2) != 0 )
{
CBlockIndex* pblockindex;
if ( (pblockindex= mapBlockIndex[hash2]) != 0 )
InvalidateBlock(state, pblockindex);
}
}
if ( KOMODO_REWIND >= 0 )
{
if (!CVerifyDB().VerifyDB(pcoinsdbview, GetArg("-checklevel", 3),

View File

@@ -720,13 +720,13 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
offset += komodo_scriptitemlen(&opretlen,&script[offset]);
if ( ASSETCHAINS_SYMBOL[0] == 0 )
{
extern int32_t KOMODO_REWIND;
/*extern int32_t KOMODO_REWIND;
if ( KOMODO_REWIND < 0 )
{
fprintf(stderr,">>>>>>> rewind.%d will pause here for a minute. issue command and stop\n",KOMODO_REWIND);
sleep(60);
KOMODO_REWIND = 0;
}
}*/
// 6a35506c65617365206d616b6520796f75722047697420636f6d6d6974206d65737361676573206d6f726520696e74657265737469 height.241778 checkdeposit n.4 [6a] [P] 80 vs 88
//for (i=0; i<opretlen; i++)
// printf("%02x",script[i]);

View File

@@ -2885,27 +2885,23 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
if (!DisconnectTip(state))
return false;
}
/*if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND )
if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND )
{
fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight);
while ( chainActive.Tip()->nHeight > KOMODO_REWIND )
{
if ( !DisconnectTip(state) )
InvalidateBlock(state,chainActive.Tip());
/*if ( !DisconnectTip(state) )
{
//InvalidateBlock(state,chainActive.Tip());
InvalidateBlock(state,chainActive.Tip());
return false;
}
}*/
}
fprintf(stderr,"end rewind ht.%d\n",chainActive.Tip()->nHeight);
if ( chainActive.Tip()->nHeight == KOMODO_REWIND )
{
fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND);
sleep(3);
return(true);
}
pindexOldTip = chainActive.Tip();
pindexFork = chainActive.FindFork(pindexMostWork);
}*/
fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND);
sleep(60);
KOMODO_REWIND = 0;
return(true);
}
// Build list of new blocks to connect.
std::vector<CBlockIndex*> vpindexToConnect;
bool fContinue = true;

View File

@@ -119,7 +119,7 @@ extern std::string NOTARY_PUBKEY;
bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned int nBits, const Consensus::Params& params)
{
//extern int32_t KOMODO_REWIND;
extern int32_t KOMODO_REWIND;
bool fNegative,fOverflow; int32_t i,nonzpkeys=0,nonz=0,special=0,special2=0,notaryid=-1,duplicate,flag = 0, mids[66];
arith_uint256 bnTarget; CBlockIndex *pindex; uint8_t pubkeys[66][33];
@@ -156,7 +156,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
if ( UintToArith256(hash) > bnTarget )
{
if ( (height < 235300 || height >= 236000) && KOMODO_LOADINGBLOCKS == 0 && height > 188000 )
//&& KOMODO_REWIND == 0 )//186269, 182507&& komodo_chainactive(height) != 0 && nonzpkeys > 0
//&& )//186269, 182507&& komodo_chainactive(height) != 0 && nonzpkeys > 0
{
int32_t i;
for (i=31; i>=0; i--)
@@ -171,7 +171,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash, unsigned in
for (i=0; i<66; i++)
printf("%d ",mids[i]);
printf(" minerids from ht.%d\n",height);
if ( notaryid >= 0 || height > 225000 )
if ( KOMODO_REWIND == 0 && (notaryid >= 0 || height > 225000) )
return error("CheckProofOfWork(): hash doesn't match nBits");
}
}

View File

@@ -806,7 +806,7 @@ void CWallet::DecrementNoteWitnesses(const CBlockIndex* pindex)
extern char ASSETCHAINS_SYMBOL[16];
fprintf(stderr,"%s nWitnessCacheSize.%d\n",ASSETCHAINS_SYMBOL,(int32_t)nWitnessCacheSize);
}
//if ( KOMODO_REWIND == 0 )
if ( KOMODO_REWIND == 0 )
assert(nWitnessCacheSize > 0);
//if (fFileBacked) {
// CWalletDB walletdb(strWalletFile);