From 713ce6589be3ca458cb7788598ae5e4f31030c27 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 13 Oct 2016 15:21:09 -0300 Subject: [PATCH] test --- iguana/iguana_notary.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 7f6265935..0cf86db6a 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -891,7 +891,7 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_block *bp,uint32_t uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info *dp,struct iguana_info *coin,struct dpow_block *bp,int32_t myind) { // todo: add RBF support - bits256 txid; int32_t vout,j,match,sigmatch,len,incr,haveutxo = 0; cJSON *addresses; char *sendtx,*rawtx,*opret_symbol,coinaddr[64]; uint32_t channel,sigchannel,txidchannel; bits256 srchash,zero; uint8_t data[4096]; int8_t lastk; + int32_t j,match,sigmatch,len,incr,haveutxo = 0; cJSON *addresses; char *sendtx,*rawtx,*opret_symbol,coinaddr[64]; uint32_t channel,sigchannel,txidchannel; bits256 srchash,zero; uint8_t data[4096]; int8_t lastk; if ( bp->numnotaries > 8 ) incr = sqrt(bp->numnotaries) + 1; else incr = 1; @@ -939,7 +939,7 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info switch ( bp->state ) { case 0: - if ( (haveutxo= dpow_haveutxo(myinfo,coin,&txid,&vout,coinaddr)) != 0 ) + if ( (haveutxo= dpow_haveutxo(myinfo,coin,&bp->notaries[myind].prev_hash,&bp->notaries[myind].prev_vout,coinaddr)) != 0 ) bp->state = 1; if ( haveutxo < 10 && time(NULL) > dp->lastsplit+600 ) { @@ -959,11 +959,9 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info } break; case 1: - if ( (haveutxo= dpow_haveutxo(myinfo,coin,&txid,&vout,coinaddr)) != 0 && vout >= 0 && vout < 0x100 ) + 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); - bp->notaries[myind].prev_hash = txid; - bp->notaries[myind].prev_vout = vout; 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 ) dpow_send(myinfo,bp,srchash,bp->hashmsg,channel,bp->height,data,len,bp->utxocrcs);