diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 6213da280..1a86432dc 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -1138,6 +1138,13 @@ void iguana_RTnewblock(struct supernet_info *myinfo,struct iguana_info *coin,str printf("iguana_RTnewblock illegal blockheight.%d\n",block->height); return; } + if ( coin->RTreset_needed != 0 ) + { + printf("RTreset_needed -> RTreset\n"); + iguana_RTreset(coin); + coin->RTreset_needed = 0; + } + if ( block != 0 && coin->RTheight > 0 && coin->RTheight <= coin->blocks.hwmchain.height ) { portable_mutex_lock(&coin->RTmutex); diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index ff02eba83..7b6ddd0b9 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -464,7 +464,12 @@ int64_t iguana_RTpkhashbalance(struct supernet_info *myinfo,struct iguana_info * if ( lastpt.isptr != 0 ) { *nump = iguana_RTscanunspents(myinfo,coin,remoteaddr,array,spentp,&deposits,unspents,max,rmd160,coinaddr,pubkey33,lastpt,lastheight); - } else printf("iguana_pkhashbalance: unexpected non-ptr lastpt\n"); + } + else + { + printf("iguana_pkhashbalance: unexpected RT non-ptr lastpt\n"); + coin->RTreset_needed = 1; + } return(deposits - *spentp); } if ( ramchain->Uextras == 0 || (rdata= ramchain->H.data) == 0 ) diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index c9cf3c3bb..bffac7f91 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -442,7 +442,7 @@ struct iguana_info int32_t MAXPEERS,MAXPENDINGREQUESTS,MAXBUNDLES,MAXSTUCKTIME,active,closestbundle,numemitted,lastsweep,numemit,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,FULLNODE,VALIDATENODE,origbalanceswritten,balanceswritten,lastRTheight,RTdatabad; bits256 balancehash,allbundles; uint32_t lastsync,parsetime,numiAddrs,lastpossible,bundlescount,savedblocks,backlog,spendvectorsaved,laststats,lastinv2,symbolcrc,spendvalidated; char VALIDATEDIR[512]; - int32_t longestchain,badlongestchain,longestchain_strange,RTramchain_busy,emitbusy,stuckiters,virtualchain,RTheight; + int32_t longestchain,badlongestchain,longestchain_strange,RTramchain_busy,emitbusy,stuckiters,virtualchain,RTheight,RTreset_needed; struct tai starttime; double startmillis; struct iguana_chain *chain; struct iguana_iAddr *iAddrs;