Browse Source

fix

blackjok3r
blackjok3r 6 years ago
parent
commit
cd71715e3a
  1. 19
      iguana/dpow/dpow_fsm.c

19
iguana/dpow/dpow_fsm.c

@ -628,12 +628,13 @@ void dpow_statemachinestart(void *ptr)
break;
// get the confirms for desttxid
if ( destnotarized == 0 && (dest_confs= dpow_txconfirms(myinfo, bp->destcoin, bp->desttxid, rettx)) != -1 )
if ( destnotarized == 0 )
{
if (dest_confs= dpow_txconfirms(myinfo, bp->destcoin, bp->desttxid, rettx)) != -1 )
{
if ( desttx[0] == 0 && rettx[0] != 0 )
{
memcpy(desttx, rettx, strlen(rettx)+1);
fprintf(stderr, "desttx.%s\n", desttx);
}
if ( dest_confs > 2 )
{
@ -644,7 +645,7 @@ void dpow_statemachinestart(void *ptr)
else if ( dest_confs == 0 )
{
// not confirmed, rebroadcast it.
fprintf(stderr, "[%s] txid.%s is not confirmed rebroadcasting....\n tx.%s",dp->dest, bits256_str(str,bp->desttxid), desttx);
fprintf(stderr, "[%s] txid.%s is not confirmed rebroadcasting....\n",dp->dest, bits256_str(str,bp->desttxid));
if ( desttx[0] != 0 )
send_dest = 1;
}
@ -656,15 +657,17 @@ void dpow_statemachinestart(void *ptr)
}
if ( send_dest == 1 && dpow_sendrawtransaction(myinfo, bp->destcoin, desttx) == 0 )
fprintf(stderr, "rebroadcast failed!\n");
}
// get the confirms for srctxid
memset(rettx,0,sizeof(rettx)); // zero out rettx!
if ( srcnotarized == 0 && (src_confs= dpow_txconfirms(myinfo, bp->srccoin, bp->srctxid, rettx)) != -1 )
if ( srcnotarized == 0 )
{
if ( (src_confs= dpow_txconfirms(myinfo, bp->srccoin, bp->srctxid, rettx)) != -1 )
{
if ( srctx[0] == 0 && rettx[0] != 0 )
{
memcpy(srctx, rettx, strlen(rettx)+1);
fprintf(stderr, "srctx.%s\n", srctx);
}
if ( src_confs > 2 )
{
@ -675,7 +678,7 @@ void dpow_statemachinestart(void *ptr)
else if ( src_confs == 0 )
{
// not confirmed, rebroadcast it.
fprintf(stderr, "[%s] txid.%s is not confirmed rebroadcasting....\n tx.%s", dp->symbol, bits256_str(str,bp->srctxid), srctx);
fprintf(stderr, "[%s] txid.%s is not confirmed rebroadcasting....\n", dp->symbol, bits256_str(str,bp->srctxid));
if ( srctx[0] != 0 )
send_src = 1;
}
@ -687,10 +690,12 @@ void dpow_statemachinestart(void *ptr)
}
if ( send_src == 1 && dpow_sendrawtransaction(myinfo, bp->srccoin, srctx) == 0 )
fprintf(stderr, "rebroadcast failed!\n");
}
// wait for approx one block before checking again.
sleep(30);
if ( destnotarized != 0 && srcnotarized != 0 ) break;
if ( destnotarized != 0 && srcnotarized != 0 )
break;
}
// unlock the dest utxo on KMD.

Loading…
Cancel
Save