Browse Source

Prevent electrum from being bob

beta
jl777 7 years ago
parent
commit
9fba11e646
  1. 5
      iguana/exchanges/LP_ordermatch.c
  2. 21
      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); printf("this node has no price for %s/%s\n",Q.srccoin,Q.destcoin);
return(retval); return(retval);
} }
if ( coin->electrum != 0 )
{
printf("electrum can only be for alice\n");
return(retval);
}
price = ask; price = ask;
autxo = &A; autxo = &A;
butxo = &B; butxo = &B;

21
iguana/exchanges/LP_signatures.c

@ -277,16 +277,19 @@ char *LP_postutxos_recv(cJSON *argjson)
char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) 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 // LP_addsig
memset(zero.bytes,0,sizeof(zero)); if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 && basecoin->electrum == 0 && relcoin->electrum == 0 )
jaddbits256(reqjson,"pubkey",G.LP_mypub25519); {
jaddstr(reqjson,"base",base); memset(zero.bytes,0,sizeof(zero));
jaddstr(reqjson,"rel",rel); jaddbits256(reqjson,"pubkey",G.LP_mypub25519);
jaddnum(reqjson,"price",price); jaddstr(reqjson,"base",base);
jaddstr(reqjson,"method","postprice"); jaddstr(reqjson,"rel",rel);
LP_reserved_msg(base,rel,zero,jprint(reqjson,1)); jaddnum(reqjson,"price",price);
return(clonestr("{\"result\":\"success\"}")); 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) char *LP_postprice_recv(cJSON *argjson)

Loading…
Cancel
Save