diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 9b6f9ed99..e1d638945 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -23,7 +23,9 @@ uint32_t basilisk_calcnonce(struct supernet_info *myinfo,uint8_t *data,int32_t d { int32_t i,numiters = 0; bits256 hash,hash2,threshold; uint32_t basilisktag; vcalc_sha256(0,hash.bytes,data,datalen); - threshold = bits256_from_compact(nBits); + if ( nBits >= GECKO_EASIESTDIFF ) + threshold = bits256_from_compact(GECKO_EASIESTDIFF); + else threshold = bits256_from_compact(nBits); for (i=0; inBits); + if ( opret->nBits >= GECKO_EASIESTDIFF ) + threshold = bits256_from_compact(GECKO_EASIESTDIFF); + else threshold = bits256_from_compact(opret->nBits); datalen = iguana_rwblockhdr(1,0,serialized,&msg); hash2 = iguana_calcblockhash("virtual",blockhash_sha256,serialized,datalen); //for (i=0; i= GECKO_EASIESTDIFF ) + threshold = bits256_from_compact(GECKO_EASIESTDIFF); + else threshold = bits256_from_compact(nBits); for (i=0; i<100000000; i++) { opret.nonce = msg.H.nonce = i; @@ -148,7 +152,9 @@ void datachain_events_processKOMODO(struct supernet_info *myinfo,struct datachai memset(symbol,0,sizeof(symbol)), memcpy(symbol,opret.symbol,sizeof(opret.symbol)); memset(name,0,sizeof(name)), memcpy(name,opret.name,sizeof(opret.name)); hash2 = datachain_opreturn_convert(txidbytes,&txlen,&msg,&opret); - threshold = bits256_from_compact(opret.nBits); + if ( opret.nBits >= GECKO_EASIESTDIFF ) + threshold = bits256_from_compact(GECKO_EASIESTDIFF); + else threshold = bits256_from_compact(opret.nBits); msg.txn_count = 1; //n = iguana_serialize_block(virt->chain,&hash2,serialized,newblock); datalen = iguana_rwblockhdr(1,0,serialized,&msg); diff --git a/gecko/gecko_miner.c b/gecko/gecko_miner.c index e628c40a0..0461162b8 100755 --- a/gecko/gecko_miner.c +++ b/gecko/gecko_miner.c @@ -43,6 +43,8 @@ int32_t gecko_blocknonce_verify(struct iguana_info *virt,uint8_t *serialized,int return(-1); } } + if ( nBits >= GECKO_EASIESTDIFF ) + nBits = GECKO_EASIESTDIFF; threshold = bits256_from_compact(nBits); hash2 = iguana_calcblockhash(virt->symbol,virt->chain->hashalgo,serialized,datalen); if ( bits256_cmp(threshold,hash2) > 0 ) @@ -203,7 +205,9 @@ char *gecko_blockconstruct(struct supernet_info *myinfo,struct iguana_info *virt { printf("%s %s\n",bits256_str(str,txids[0]),bits256_str(str2,txids[1])); } - threshold = bits256_from_compact(newblock->RO.bits); + if ( newblock->RO.bits >= GECKO_EASIESTDIFF ) + bits256_from_compact(GECKO_EASIESTDIFF); + else threshold = bits256_from_compact(newblock->RO.bits); if ( (newblock->RO.nonce= *noncep) == 0 ) { for (i=0; i