jl777 7 years ago
parent
commit
d3c0cbec0d
  1. 6
      iguana/exchanges/LP_commands.c
  2. 6
      iguana/exchanges/LP_ordermatch.c

6
iguana/exchanges/LP_commands.c

@ -367,9 +367,15 @@ dividends(coin, height, <args>)\n\
else if ( IAMLP == 0 && LP_isdisabled(jstr(argjson,"coin"),0) != 0 )
retstr = clonestr("{\"result\":\"coin is disabled\"}");
else if ( strcmp(method,"reserved") == 0 )
{
printf("RESERVED.(%s)\n",jprint(argjson,0));
retstr = LP_quotereceived(argjson);
}
else if ( strcmp(method,"connected") == 0 )
{
printf("CONNECTED.(%s)\n",jprint(argjson,0));
retstr = LP_connectedalice(argjson);
}
else if ( strcmp(method,"checktxid") == 0 )
retstr = LP_spentcheck(argjson);
else if ( strcmp(method,"getcoins") == 0 )

6
iguana/exchanges/LP_ordermatch.c

@ -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));
}

Loading…
Cancel
Save