]> Git Repo - VerusCoin.git/commitdiff
End free4all at height 1 million, cap PoSdiff to mindiff*4
authorjl777 <[email protected]>
Wed, 27 Jun 2018 11:40:49 +0000 (00:40 -1100)
committerjl777 <[email protected]>
Wed, 27 Jun 2018 11:40:49 +0000 (00:40 -1100)
src/komodo_bitcoind.h
src/miner.cpp
src/pow.cpp

index 5a41c2bfc58eafe268282e8bfbd7df7cba0bce8d..fb3d2702b7fa4e8ad92f6030434124bfed065d71 100644 (file)
@@ -1088,7 +1088,11 @@ uint32_t komodo_segid32(char *coinaddr)
 
 uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_t vout,uint32_t blocktime,uint32_t prevtime,char *destaddr)
 {
-    CBlockIndex *pindex; uint8_t hashbuf[128]; char address[64]; bits256 addrhash; arith_uint256 hashval; uint256 hash,pasthash; int64_t diff=0; int32_t segid,minage,i,iter=0; uint32_t txtime,winner = 0; uint64_t value,coinage,supply = ASSETCHAINS_SUPPLY + nHeight*ASSETCHAINS_REWARD/SATOSHIDEN;
+    CBlockIndex *pindex; bool fNegative,fOverflow; uint8_t hashbuf[128]; char address[64]; bits256 addrhash; arith_uint256 hashval; uint256 hash,pasthash; int64_t diff=0; int32_t segid,minage,i,iter=0; uint32_t txtime,winner = 0; arith_uint256 bnMaxPoSdiff; uint64_t value,coinage,supply = ASSETCHAINS_SUPPLY + nHeight*ASSETCHAINS_REWARD/SATOSHIDEN;
+    bnMaxPoSdiff.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow);
+    bnMaxPoSdiff = (bnMaxPoSdiff / arith_uint256(4));
+    if ( bnTarget > bnMaxPoSdiff )
+        bnTarget = bnMaxPoSdiff;
     txtime = komodo_txtime(&value,txid,vout,address);
     if ( blocktime < prevtime+57 )
         blocktime = prevtime+57;
index ec410384fd568d3ffbebf2ef74879cc9e86f6b9d..6008fd5d9c18bc0685b7e8657252989c5edca043 100644 (file)
@@ -861,7 +861,7 @@ void static BitcoinMiner()
             if ( ASSETCHAINS_SYMBOL[0] == 0 && notaryid >= 0 )
             {
                 j = 65;
-                if ( (Mining_height >= 235300 && Mining_height < 236000) || (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 )
+                if ( (Mining_height >= 235300 && Mining_height < 236000) || (Mining_height % KOMODO_ELECTION_GAP) > 64 || (Mining_height % KOMODO_ELECTION_GAP) == 0 || Mining_height > 1000000 )
                 {
                     int32_t dispflag = 0;
                     if ( notaryid <= 3 || notaryid == 32 || (notaryid >= 43 && notaryid <= 45) ||notaryid == 51 || notaryid == 52 || notaryid == 56 || notaryid == 57 || notaryid == 62 )
index e942883f271c0a6a9a965ab0fcb873daebf04b7e..2e525e8cbee95d201a94e431227af0980e9a0ff0 100644 (file)
@@ -172,7 +172,7 @@ bool CheckProofOfWork(int32_t height,uint8_t *pubkey33,uint256 hash,unsigned int
             else if ( height >= 80000 && height < 108000 && special2 > 0 )
                 flag = 1;
             else if ( height >= 108000 && special2 > 0 )
-                flag = ((height % KOMODO_ELECTION_GAP) > 64 || (height % KOMODO_ELECTION_GAP) == 0);
+                flag = (height > 1000000 || (height % KOMODO_ELECTION_GAP) > 64 || (height % KOMODO_ELECTION_GAP) == 0);
             else if ( height == 790833 )
                 flag = 1;
             else if ( special2 < 0 )
This page took 0.030219 seconds and 4 git commands to generate.