diff --git a/gecko/gecko.c b/gecko/gecko.c index c168d780e..bcf27c76f 100755 --- a/gecko/gecko.c +++ b/gecko/gecko.c @@ -14,16 +14,16 @@ * * ******************************************************************************/ -// code mempool and tx (payment and opreturn protocol) - -// debug genesis balances -// debug remote <-> server and p2p network +// + code mempool and tx (payment and opreturn protocol) +// + debug remote <-> server and p2p network +// port DEX to use geckochain +// debug DEXchain // debug network port mode // debug virtual + network port mode + +// debug genesis balances // debug reorgs, detect when network is forked -// port DEX to use geckochain -// debug DEXchain // code subchains synchronized with parent chain // port pangea to use gecko with subchains diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index ef199f3f8..bb4ea1188 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -360,7 +360,13 @@ int32_t iguana_realtime_update(struct supernet_info *myinfo,struct iguana_info * printf("<<<< flag.%d RT.%d:%d hwm.%d L.%d T.%d U.%d S.%d P.%d X.%d -> size.%ld\n",flag,coin->RTheight,n,coin->blocks.hwmchain.height,coin->longestchain,dest->H.txidind,dest->H.unspentind,dest->H.spendind,dest->pkind,dest->externalind,dest->H.data!=0?(long)dest->H.data->allocsize:-1); if ( coin->RTdatabad != 0 ) { + bits256 lastbundle; iguana_RTramchainfree(coin,bp); + if ( coin->RTdatabad < 0 ) + { + memset(lastbundle.bytes,0,sizeof(lastbundle)); + iguana_initfinal(coin,lastbundle); + } coin->RTdatabad = 0; //memset(bp->hashes,0,sizeof(bp->hashes)); memset(bp->blocks,0,sizeof(bp->blocks)); diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index e0a72b017..bb80477f9 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -1101,6 +1101,8 @@ int32_t iguana_bundlevalidate(struct iguana_info *coin,struct iguana_bundle *bp, free(blockspace); bp->validated = (uint32_t)time(NULL); printf("VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",bp->hdrsi,bp->bundleheight,bp->validated - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid); + if ( bp == coin->current ) + coin->RTdatabad = 1; } if ( errs == 0 && fp == 0 ) { diff --git a/iguana/iguana_volatiles.c b/iguana/iguana_volatiles.c index 0c3ba50b7..8c76e2d5f 100755 --- a/iguana/iguana_volatiles.c +++ b/iguana/iguana_volatiles.c @@ -88,7 +88,7 @@ struct iguana_utxo iguana_utxofind(struct iguana_info *coin,int16_t spent_hdrsi, memset(&utxo,0,sizeof(utxo)); if ( (bp= coin->bundles[spent_hdrsi]) == 0 ) return(utxo); - ramchain = &bp->ramchain;//(bp == coin->current) ? &coin->RTramchain : &bp->ramchain; + ramchain = (bp == coin->current) ? &coin->RTramchain : &bp->ramchain; if ( (rdata= ramchain->H.data) == 0 ) return(utxo); val = ((uint64_t)spent_hdrsi << 32) | spent_unspentind;