|
@ -670,6 +670,7 @@ cJSON *BOB_waitfeefunc(struct supernet_info *myinfo,struct exchange_info *exchan |
|
|
coinbtc = iguana_coinfind("BTC"); |
|
|
coinbtc = iguana_coinfind("BTC"); |
|
|
*serdatap = 0, *serdatalenp = 0; |
|
|
*serdatap = 0, *serdatalenp = 0; |
|
|
strcpy(swap->waitfortx,"fee"); |
|
|
strcpy(swap->waitfortx,"fee"); |
|
|
|
|
|
printf("BOB wait other.%p\n",swap->otherfee); |
|
|
if ( coinbtc != 0 && swap->otherfee != 0 )//swap->deposit == 0 && (retstr= BTC_txconfirmed(myinfo,coinbtc,swap,newjson,swap->otherfee->txid,&swap->otherfee->numconfirms,"feefound",0)) != 0 )
|
|
|
if ( coinbtc != 0 && swap->otherfee != 0 )//swap->deposit == 0 && (retstr= BTC_txconfirmed(myinfo,coinbtc,swap,newjson,swap->otherfee->txid,&swap->otherfee->numconfirms,"feefound",0)) != 0 )
|
|
|
{ |
|
|
{ |
|
|
retstr = swap->otherfee->txbytes; |
|
|
retstr = swap->otherfee->txbytes; |
|
@ -745,6 +746,7 @@ cJSON *ALICE_waitfeefunc(struct supernet_info *myinfo,struct exchange_info *exch |
|
|
coinbtc = iguana_coinfind("BTC"); |
|
|
coinbtc = iguana_coinfind("BTC"); |
|
|
*serdatap = 0, *serdatalenp = 0; |
|
|
*serdatap = 0, *serdatalenp = 0; |
|
|
strcpy(swap->waitfortx,"fee"); |
|
|
strcpy(swap->waitfortx,"fee"); |
|
|
|
|
|
printf("ALICE wait other.%p\n",swap->otherfee); |
|
|
if ( coinbtc != 0 && swap->otherfee != 0 )//&& (retstr= BTC_txconfirmed(myinfo,coinbtc,swap,newjson,swap->otherfee->txid,&swap->otherfee->numconfirms,"feefound",0)) != 0 )
|
|
|
if ( coinbtc != 0 && swap->otherfee != 0 )//&& (retstr= BTC_txconfirmed(myinfo,coinbtc,swap,newjson,swap->otherfee->txid,&swap->otherfee->numconfirms,"feefound",0)) != 0 )
|
|
|
{ |
|
|
{ |
|
|
retstr = swap->otherfee->txbytes; |
|
|
retstr = swap->otherfee->txbytes; |
|
@ -1017,6 +1019,21 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n) |
|
|
return(s); |
|
|
return(s); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
struct bitcoin_eventitem *instantdex_event(char *cmdstr,cJSON *argjson,cJSON *newjson,uint8_t *serdata,int32_t serdatalen) |
|
|
|
|
|
{ |
|
|
|
|
|
struct bitcoin_eventitem *ptr; |
|
|
|
|
|
ptr = calloc(1,sizeof(*ptr) + serdatalen); |
|
|
|
|
|
strcpy(ptr->cmd,cmdstr); |
|
|
|
|
|
ptr->newjson = jduplicate(newjson); |
|
|
|
|
|
ptr->argjson = jduplicate(argjson); |
|
|
|
|
|
if ( serdatalen != 0 ) |
|
|
|
|
|
{ |
|
|
|
|
|
memcpy(ptr->serdata,serdata,serdatalen); |
|
|
|
|
|
ptr->serdatalen = serdatalen; |
|
|
|
|
|
} |
|
|
|
|
|
return(ptr); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
void instantdex_eventfree(struct bitcoin_eventitem *ptr) |
|
|
void instantdex_eventfree(struct bitcoin_eventitem *ptr) |
|
|
{ |
|
|
{ |
|
|
if ( ptr != 0 ) |
|
|
if ( ptr != 0 ) |
|
|