jl777 8 years ago
parent
commit
40bc536f2f
  1. 31
      iguana/dpow/dpow_fsm.c

31
iguana/dpow/dpow_fsm.c

@ -284,28 +284,17 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
printf("sigmatch.%d\n",sigmatch); printf("sigmatch.%d\n",sigmatch);
dpow_sigscheck(myinfo,bp,sigchannel,myind,src_or_dest); dpow_sigscheck(myinfo,bp,sigchannel,myind,src_or_dest);
} }
switch ( bp->state ) if ( bp->state < 10 )
{ {
case 0: dpow_utxosync(myinfo,bp,0,myind,srchash);
dpow_utxosync(myinfo,bp,0,myind,srchash); bp->state++;
bp->state = 1; }
break; else
case 1: {
dpow_utxosync(myinfo,bp,0,myind,srchash); dpow_update(myinfo,bp,channel,sigchannel,txidchannel,srchash,myind,src_or_dest);
//dpow_lastk_mask(bp,&lastk); if ( bits256_nonz(bp->signedtxid) != 0 )
//memset(&U,0,sizeof(U)); bp->state = 0xffffffff;
//dpow_entry2utxo(&U,bp,&bp->notaries[myind]);
//if ( (len= dpow_rwutxobuf(1,data,&U,bp)) > 0 )
// dpow_send(myinfo,bp,srchash,bp->hashmsg,channel,bp->height,data,len,bp->utxocrcs);
//bp->recvmask |= (1LL << myind);
bp->state = 2;
break;
default:
dpow_update(myinfo,bp,channel,sigchannel,txidchannel,srchash,myind,src_or_dest);
break;
} }
if ( bits256_nonz(bp->signedtxid) != 0 )
bp->state = 0xffffffff;
return(bp->state); return(bp->state);
} }
@ -403,8 +392,6 @@ void dpow_statemachinestart(void *ptr)
for (i=0; i<sizeof(srchash); i++) for (i=0; i<sizeof(srchash); i++)
srchash.bytes[i] = myinfo->DPOW.minerkey33[i+1]; srchash.bytes[i] = myinfo->DPOW.minerkey33[i+1];
dpow_utxosync(myinfo,bp,0,myind,srchash); dpow_utxosync(myinfo,bp,0,myind,srchash);
sleep(3);
dpow_utxosync(myinfo,bp,0,myind,srchash);
while ( time(NULL) < starttime+300 && src != 0 && dest != 0 && bp->state != 0xffffffff ) while ( time(NULL) < starttime+300 && src != 0 && dest != 0 && bp->state != 0xffffffff )
{ {
sleep(2); sleep(2);

Loading…
Cancel
Save