diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 81812c3a9..670537343 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -116,7 +116,7 @@ struct dpow_block struct dpow_recvdata recv[64]; struct dpow_entry notaries[DPOW_MAXRELAYS]; uint32_t MoMdepth,state,starttime,timestamp,waiting,sigcrcs[2],txidcrcs[2],utxocrcs[2],lastepoch,paxwdcrc,lastnanosend; - int32_t rawratifiedlens[2],height,numnotaries,numerrors,completed,minsigs,duration,numratified,isratify,require0,scores[DPOW_MAXRELAYS]; + int32_t rawratifiedlens[2],height,numnotaries,numerrors,completed,minsigs,duration,numratified,isratify,require0,scores[DPOW_MAXRELAYS],destht_start; int8_t myind,bestk,ratifybestk,pendingbestk,pendingratifybestk,matches,bestmatches; cJSON *ratified; uint16_t CCid; diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 97640b59a..fc8724a6b 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -309,6 +309,7 @@ void dpow_statemachinestart(void *ptr) bp->srccoin = src; bp->destcoin = dest; bp->myind = -1; + bp->destht_start = dp->DESTHEIGHT; for (i=0; inotaries)/sizeof(*bp->notaries); i++) bp->notaries[i].bestk = -1; bp->opret_symbol = dp->symbol; diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index b17d409d5..d3813c068 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -2002,16 +2002,16 @@ void dpow_notarize_update(struct supernet_info *myinfo,struct dpow_info *dp,stru // check that block has advanced by 1 on KMD before allowing bestmask to be calculated - if ( strcmp(bp->destcoin->symbol,"KMD") != 0 ) + if ( strcmp(bp->destcoin->symbol,"KMD") == 0 ) { - fprintf(stderr, "X->KMD: checkpoint ht.%i vs longestchain.%i\n", bp->height, bp->srccoin->longestchain); - if ( bp->height == bp->srccoin->longestchain ) + fprintf(stderr, "X->KMD: checkpoint ht.%i vs longestchain.%i\n", bp->destht_start, bp->destcoin->longestchain); + if ( bp->destht_start == bp->destcoin->longestchain ) return; } else { - fprintf(stderr, "KMD->BTC: checkpoint ht.%i vs longestchain.%i\n", bp->height, bp->destcoin->longestchain); - if ( bp->height == bp->destcoin->longestchain ) + fprintf(stderr, "KMD->BTC: checkpoint ht.%i vs longestchain.%i\n", bp->height , bp->srccoin->longestchain); + if ( bp->height == bp->srccoin->longestchain ) return; }