jl777 9 years ago
parent
commit
c37b076adf
  1. 7
      iguana/iguana_notary.c

7
iguana/iguana_notary.c

@ -945,7 +945,7 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
switch ( bp->state ) switch ( bp->state )
{ {
case 0: case 0:
if ( (haveutxo= dpow_haveutxo(myinfo,coin,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,coinaddr)) != 0 ) if ( (haveutxo= dpow_haveutxo(myinfo,coin,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,coinaddr)) != 0 && bits256_nonz(bp->notaries[myind].prev_hash) != 0 )
bp->state = 1; bp->state = 1;
if ( haveutxo < 10 && time(NULL) > dp->lastsplit+600 ) if ( haveutxo < 10 && time(NULL) > dp->lastsplit+600 )
{ {
@ -965,14 +965,11 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info
} }
break; break;
case 1: case 1:
if ( (haveutxo= dpow_haveutxo(myinfo,coin,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,coinaddr)) != 0 && bp->notaries[myind].prev_vout >= 0 && bp->notaries[myind].prev_vout < 0x100 )
{
bp->recvmask |= (1LL << myind);
dpow_lastk_mask(bp,&lastk); dpow_lastk_mask(bp,&lastk);
if ( (len= dpow_rwutxobuf(1,data,&bp->hashmsg,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,&bp->commit,bp->notaries[myind].pubkey,&lastk,&bp->recvmask)) > 0 ) if ( (len= dpow_rwutxobuf(1,data,&bp->hashmsg,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,&bp->commit,bp->notaries[myind].pubkey,&lastk,&bp->recvmask)) > 0 )
dpow_send(myinfo,bp,srchash,bp->hashmsg,channel,bp->height,data,len,bp->utxocrcs); dpow_send(myinfo,bp,srchash,bp->hashmsg,channel,bp->height,data,len,bp->utxocrcs);
bp->recvmask |= (1LL << myind);
bp->state = 2; bp->state = 2;
}
break; break;
default: default:
dpow_update(myinfo,bp,channel,sigchannel,txidchannel,srchash,myind); dpow_update(myinfo,bp,channel,sigchannel,txidchannel,srchash,myind);

Loading…
Cancel
Save