|
|
@ -493,10 +493,10 @@ int32_t LP_connectstartbob(void *ctx,int32_t pubsock,cJSON *argjson,char *base,c |
|
|
|
jaddstr(retjson,"pair",pairstr); |
|
|
|
char str[65]; printf("BOB pubsock.%d binds to %d (%s)\n",pubsock,pair,bits256_str(str,qp->desthash)); |
|
|
|
LP_reserved_msg(1,base,rel,qp->desthash,jprint(retjson,0)); |
|
|
|
sleep(1); |
|
|
|
bits256 zero; |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
LP_reserved_msg(1,base,rel,zero,jprint(retjson,0)); |
|
|
|
LP_reserved_msg(0,base,rel,zero,jprint(retjson,0)); |
|
|
|
free_json(retjson); |
|
|
|
retval = 0; |
|
|
|
} else printf("error launching swaploop\n"); |
|
|
@ -998,14 +998,15 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
jaddnum(retjson,"pending",Q.timestamp + LP_RESERVETIME); |
|
|
|
//jaddbits256(retjson,"desthash",Q.desthash);
|
|
|
|
jaddstr(retjson,"method","reserved"); |
|
|
|
msg = jprint(retjson,0); |
|
|
|
msg = jprint(retjson,1); |
|
|
|
printf("return after queued RESERVED: set swappending.%u accept qprice %.8f, min %.8f\n(%s)\n",Q.timestamp + LP_RESERVETIME,qprice,ask,msg); |
|
|
|
LP_reserved_msg(1,Q.srccoin,Q.destcoin,Q.desthash,clonestr(msg)); |
|
|
|
sleep(1); |
|
|
|
//sleep(1);
|
|
|
|
bits256 zero; |
|
|
|
memset(zero.bytes,0,sizeof(zero)); |
|
|
|
LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,msg); |
|
|
|
free_json(retjson); |
|
|
|
LP_reserved_msg(1,Q.srccoin,Q.destcoin,zero,clonestr(msg)); |
|
|
|
LP_reserved_msg(0,Q.srccoin,Q.destcoin,zero,clonestr(msg)); |
|
|
|
free(msg); |
|
|
|
butxo->T.lasttime = (uint32_t)time(NULL); |
|
|
|
return(retval); |
|
|
|
} else printf("request processing selected ineligible utxos?\n"); |
|
|
|