|
|
@ -709,7 +709,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
if ( (method= jstr(argjson,"method")) != 0 && (strcmp(method,"request") == 0 ||strcmp(method,"connect") == 0) ) |
|
|
|
{ |
|
|
|
printf("LP_tradecommand: check received %s\n",method); |
|
|
|
//retval = 1;
|
|
|
|
retval = 1; |
|
|
|
if ( LP_quoteparse(&Q,argjson) == 0 && bits256_cmp(LP_mypub25519,Q.srchash) == 0 && bits256_cmp(LP_mypub25519,Q.desthash) != 0 ) |
|
|
|
{ |
|
|
|
printf("TRADECOMMAND.(%s)\n",jprint(argjson,0)); |
|
|
@ -772,7 +772,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
//memset(&zero,0,sizeof(zero));
|
|
|
|
LP_broadcast_message(pubsock,Q.srccoin,Q.destcoin,butxo->S.otherpubkey,msg); |
|
|
|
LP_butxo_swapfields_set(butxo); |
|
|
|
return(1); |
|
|
|
return(2); |
|
|
|
} |
|
|
|
} else printf("warning swappending.%u swap.%p\n",butxo->T.swappending,butxo->S.swap); |
|
|
|
} |
|
|
@ -784,7 +784,7 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, |
|
|
|
// validate SPV alice
|
|
|
|
LP_connectstartbob(ctx,pubsock,butxo,argjson,Q.srccoin,Q.destcoin,qprice,&Q); |
|
|
|
LP_butxo_swapfields_set(butxo); |
|
|
|
return(2); |
|
|
|
return(3); |
|
|
|
} |
|
|
|
else printf("pend.%u swap %p when connect came in (%s)\n",butxo->T.swappending,butxo->S.swap,jprint(argjson,0)); |
|
|
|
} |
|
|
|