Browse Source

Prevent electrum from being bob

beta
jl777 7 years ago
parent
commit
9fba11e646
  1. 5
      iguana/exchanges/LP_ordermatch.c
  2. 5
      iguana/exchanges/LP_signatures.c

5
iguana/exchanges/LP_ordermatch.c

@ -627,6 +627,11 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,
printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin);
return(retval);
}
if ( coin->electrum != 0 )
{
printf("electrum can only be for alice\n");
return(retval);
}
price = ask;
autxo = &A;
butxo = &B;

5
iguana/exchanges/LP_signatures.c

@ -277,8 +277,10 @@ char *LP_postutxos_recv(cJSON *argjson)
char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price)
{
bits256 zero; cJSON *reqjson = cJSON_CreateObject();
struct iguana_info *basecoin,*relcoin; bits256 zero; cJSON *reqjson = cJSON_CreateObject();
// LP_addsig
if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 && relcoin->electrum == 0 )
{
memset(zero.bytes,0,sizeof(zero));
jaddbits256(reqjson,"pubkey",G.LP_mypub25519);
jaddstr(reqjson,"base",base);
@ -287,6 +289,7 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re
jaddstr(reqjson,"method","postprice");
LP_reserved_msg(base,rel,zero,jprint(reqjson,1));
return(clonestr("{\"result\":\"success\"}"));
} else return(clonestr("{\"error\":\"electrum node cant post bob asks\"}"));
}
char *LP_postprice_recv(cJSON *argjson)

Loading…
Cancel
Save