Browse Source

mroe debug

blackjok3r
blackjok3r 6 years ago
parent
commit
6f4dbfeec9
  1. 14
      iguana/dpow/dpow_fsm.c
  2. 5
      iguana/dpow/dpow_rpc.c

14
iguana/dpow/dpow_fsm.c

@ -617,7 +617,7 @@ void dpow_statemachinestart(void *ptr)
// We need to wait for notarized confirm here. If the notarization is reorged for any reason we need to rebroadcast it,
// 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],rettx[32768]; char *retstr=0;
char desttx[32768],srctx[32768]; char *retstr=0;
while ( 1 )
{
int8_t send_dest = 0, send_src = 0;
@ -630,7 +630,7 @@ void dpow_statemachinestart(void *ptr)
//sleep((rand() % (240 - 30)) + 30);
// get the confirms for desttxid
memset(rettx,0,sizeof(rettx)); // zero out rettx!
char rettx[32768] = {0};
if ( destnotarized == 0 )
{
if ( (dest_confs= dpow_txconfirms(myinfo, bp->destcoin, bp->desttxid, rettx)) != -1 )
@ -639,6 +639,7 @@ void dpow_statemachinestart(void *ptr)
{
memset(desttx,0,sizeof(desttx)); // zero out desttx.
memcpy(desttx, rettx, strlen(rettx)+1);
fprintf(stderr, ">>> after copy: desttx.%s\n",desttx);
}
if ( dest_confs > 2 )
{
@ -659,8 +660,13 @@ void dpow_statemachinestart(void *ptr)
fprintf(stderr, "cant find tx.%s rebroadcasting...\n", bits256_str(str,bp->desttxid));
send_dest = 1;
}
if ( send_dest == 1 && dpow_sendrawtransaction(myinfo, bp->destcoin, desttx) == 0 )
fprintf(stderr, "rebroadcast failed!\n");
if ( send_dest == 1 )
{
if ( dpow_sendrawtransaction(myinfo, bp->destcoin, desttx) != 0 )
{
fprintf(stderr, "desttx.%s\n", desttx);
}
}
}
// get the confirms for srctxid

5
iguana/dpow/dpow_rpc.c

@ -779,7 +779,10 @@ char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *c
jaddistr(array,signedtx);
paramstr = jprint(array,1);
retstr = bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"sendrawtransaction",paramstr);
printf(">>>>>>>>>>> %s dpow_sendrawtransaction (%s)\n paramstr.%s",coin->symbol,retstr, paramstr);
if ( strcmp("KMD", coin->symbol) == 0 )
fprintf(stderr,">>>>>>>>>>> %s dpow_sendrawtransaction (%s)\n paramstr.%s\n tx.%s\n",coin->symbol,retstr, paramstr, signedtx);
else
fprintf(stderr,">>>>>>>>>>> %s dpow_sendrawtransaction (%s)\n",coin->symbol,retstr);
free(paramstr);
return(retstr);
}

Loading…
Cancel
Save