diff --git a/iguana/exchanges/LP_stats.c b/iguana/exchanges/LP_stats.c index 3532472b0..81643c224 100644 --- a/iguana/exchanges/LP_stats.c +++ b/iguana/exchanges/LP_stats.c @@ -302,23 +302,23 @@ int32_t LP_swap_finished(struct LP_swapstats *sp,int32_t dPoWflag) { if ( sp->expired != 0 ) return(1); - if ( dPoWflag != 0 ) + } + if ( dPoWflag != 0 ) + { + if ( sp->dPoWfinished != 0 ) + return(1); + else if ( sp->finished != 0 ) { - if ( sp->finished != 0 && sp->dPoWfinished != 0 ) - return(1); - else if ( sp->finished != 0 ) - { - if ( bob->isassetchain != 0 ) - sp->bobneeds_dPoW = LP_finished_lastheight(sp,1); - if ( alice->isassetchain != 0 ) - sp->aliceneeds_dPoW = LP_finished_lastheight(sp,0); - printf("bob needs %d @ %d, alice needs %d @ %d\n",sp->bobneeds_dPoW,bob->notarized,sp->aliceneeds_dPoW,alice->notarized); - } - if ( (sp->bobneeds_dPoW == 0 || (sp->bobneeds_dPoW > 1 && bob->notarized >= sp->bobneeds_dPoW)) && (sp->aliceneeds_dPoW == 0 || (sp->aliceneeds_dPoW > 1 && alice->notarized >= sp->aliceneeds_dPoW)) ) - { - sp->dPoWfinished = (uint32_t)time(NULL); - return(1); - } + if ( bob->isassetchain != 0 ) + sp->bobneeds_dPoW = LP_finished_lastheight(sp,1); + if ( alice->isassetchain != 0 ) + sp->aliceneeds_dPoW = LP_finished_lastheight(sp,0); + printf("bob needs %d @ %d, alice needs %d @ %d\n",sp->bobneeds_dPoW,bob->notarized,sp->aliceneeds_dPoW,alice->notarized); + } + if ( (sp->bobneeds_dPoW == 0 || (sp->bobneeds_dPoW > 1 && bob->notarized >= sp->bobneeds_dPoW)) && (sp->aliceneeds_dPoW == 0 || (sp->aliceneeds_dPoW > 1 && alice->notarized >= sp->aliceneeds_dPoW)) ) + { + sp->dPoWfinished = (uint32_t)time(NULL); + return(1); } } return(0);