diff --git a/basilisk/basilisk_swap.c b/basilisk/basilisk_swap.c index bced7218b..3cd1dc178 100755 --- a/basilisk/basilisk_swap.c +++ b/basilisk/basilisk_swap.c @@ -1022,15 +1022,16 @@ void basilisk_rawtx_setparms(char *name,struct supernet_info *myinfo,struct basi int32_t bitcoin_coinptrs(struct supernet_info *myinfo,struct iguana_info **bobcoinp,struct iguana_info **alicecoinp,char *src,char *dest,bits256 srchash,bits256 desthash) { + struct iguana_info *coin = iguana_coinfind(src); *bobcoinp = *alicecoinp = 0; - if ( strcmp("BTC",src) == 0 ) + if ( strcmp("BTC",src) == 0 || coin->notarychain >= 0 ) { - *bobcoinp = iguana_coinfind("BTC"); + *bobcoinp = iguana_coinfind(src); *alicecoinp = iguana_coinfind(dest); } - else if ( strcmp("BTC",dest) == 0 ) + else //if ( strcmp("BTC",dest) == 0 ) { - *bobcoinp = iguana_coinfind("BTC"); + *bobcoinp = iguana_coinfind(dest); *alicecoinp = iguana_coinfind(src); } if ( bits256_cmp(myinfo->myaddr.persistent,srchash) == 0 ) diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index fe0d1655b..a93d915d4 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -70,7 +70,7 @@ int32_t signed_nn_recv(void **freeptrp,void *ctx,uint8_t notaries[64][33],int32_ { *(void **)packetp = (void **)((uint64_t)sigpacket + sizeof(*sigpacket)); *freeptrp = sigpacket; - //printf("got signed packet from notary0\n"); + printf("got signed packet from notary0\n"); return((int32_t)(recvbytes - sizeof(*sigpacket))); } for (i=0; iIAMNOTARY == 0 && subsock < 0 && (subsock= nn_socket(AF_SP,NN_SUB)) >= 0 ) @@ -296,7 +296,8 @@ char *_dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *data,int3 printf("%d: subscribe connect (%s)\n",myinfo->numdexipbits,str); } } - //nn_connect(myinfo->reqsock,nanomsg_tcpname(0,str,ipaddr,REP_SOCK)); + nanomsg_tcpname(0,str,ipaddr,REP_SOCK); + //nn_connect(myinfo->reqsock,str); printf("%d: req connect (%s)\n",myinfo->numdexipbits,str); } } @@ -485,7 +486,7 @@ char *dex_reqsend(struct supernet_info *myinfo,char *handler,uint8_t *data,int32 { if ( (retstrs[j]= _dex_reqsend(myinfo,handler,data,datalen)) != 0 ) { - //printf("j.%d of max.%d M.%d (%s)\n",j,max,M,retstrs[j]); + printf("j.%d of max.%d M.%d (%s)\n",j,max,M,retstrs[j]); if ( strncmp(retstrs[j],"{\"error\":\"null return\"}",strlen("{\"error\":\"null return\"}")) != 0 && strncmp(retstrs[j],"[]",strlen("[]")) != 0 && strcmp("0",retstrs[j]) != 0 ) { if ( ++j == M ) @@ -1564,7 +1565,7 @@ int32_t dpow_nanomsg_update(struct supernet_info *myinfo) break; usleep(1000); }*/ - while ( (size= signed_nn_recv(&freeptr,myinfo->ctx,myinfo->notaries,myinfo->numnotaries,myinfo->dpowsock,&np)) >= 0 && num < 100 ) + while ( (size= signed_nn_recv(&freeptr,myinfo->ctx,myinfo->notaries,myinfo->numnotaries,myinfo->dpowsock,&np)) >= 0 && num < 300 ) { num++; if ( size > 0 ) diff --git a/iguana/tests/requestM b/iguana/tests/requestM new file mode 100755 index 000000000..c480eef39 --- /dev/null +++ b/iguana/tests/requestM @@ -0,0 +1,3 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"request\",\"vals\":{\"source\":\"MVP\",\"amount\":0.1,\"dest\":\"USD\",\"minprice\":0.09}}" +