|
|
@ -615,18 +615,19 @@ void dpow_statemachinestart(void *ptr) |
|
|
|
dp->ratifying -= bp->isratify; |
|
|
|
|
|
|
|
// We need to wait for notarized confirm here. If the notarization is reorged for any reason we need to rebroadcast it,
|
|
|
|
// becasue the mempool is stupid after the sapling update!
|
|
|
|
// because the mempool is stupid after the sapling update, or Alright might be playing silly games.
|
|
|
|
int8_t dest_confs = 0, src_confs = 0, destnotarized = 0, srcnotarized = 0; |
|
|
|
char desttx[32768],srctx[32768]; char *retstr=0; |
|
|
|
while ( 1 ) |
|
|
|
{ |
|
|
|
// If the round was sucessful and both notarizations were created successfully we will make sure they are in the chain.
|
|
|
|
if ( bits256_cmp(bp->desttxid,zero) == 0 ) |
|
|
|
break; |
|
|
|
if ( bits256_cmp(bp->srctxid,zero) == 0 ) |
|
|
|
if ( bits256_cmp(bp->srctxid,zero) == 0 ) |
|
|
|
break; |
|
|
|
|
|
|
|
// get the confirms for desttxid
|
|
|
|
if ( destnotarized == 0 && (dest_confs= dpow_txconfirms(myinfo, bp->destcoin, bp->desttxid)) != -1 ) |
|
|
|
if ( destnotarized == 0 && (dest_confs= dpow_txconfirms(myinfo, bp->destcoin, bp->desttxid, &desttx)) != -1 ) |
|
|
|
{ |
|
|
|
if ( dest_confs > 2 ) |
|
|
|
{ |
|
|
@ -637,7 +638,12 @@ void dpow_statemachinestart(void *ptr) |
|
|
|
else if ( dest_confs == 0 ) |
|
|
|
{ |
|
|
|
// not confirmed, rebroadcast it.
|
|
|
|
fprintf(stderr, "[%s] txid.%s is not confirmed at all rebroadcasting.... \n",dp->dest, bits256_str(str,bp->desttxid)); |
|
|
|
fprintf(stderr, "[%s] txid.%s is not confirmed rebroadcasting.... \n tx.%s",dp->dest, bits256_str(str,bp->desttxid), desttx); |
|
|
|
if ( desttx[0] != 0 ) |
|
|
|
{ |
|
|
|
if ( dpow_sendrawtransaction(myinfo, bp->destcoin, desttx) == 0 ) |
|
|
|
fprintf(stderr, "rebroadcast failed!\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
} else fprintf(stderr, "[%s] txid.%s returned error for txconfirms",dp->dest, bits256_str(str,bp->desttxid)); |
|
|
|
|
|
|
@ -650,13 +656,9 @@ void dpow_statemachinestart(void *ptr) |
|
|
|
fprintf(stderr, "[%s] txid.%s is notarized or has 100 confirms \n",bp->symbol, bits256_str(str,bp->srctxid)); |
|
|
|
} |
|
|
|
} */ |
|
|
|
// check here for confirms exists in return JSON, if no confirms, keep rebroadcasting.
|
|
|
|
// if confirms > 2 exit loop.
|
|
|
|
|
|
|
|
// as a safety, if rawconfirmations > 100 exit this loop.
|
|
|
|
|
|
|
|
// wait for approx one block before checking again.
|
|
|
|
sleep(60); |
|
|
|
sleep(30); |
|
|
|
if ( destnotarized != 0 ) break; |
|
|
|
} |
|
|
|
|
|
|
|