jl777 7 years ago
parent
commit
f4ebbd3d11
  1. 2
      iguana/exchanges/LP_include.h
  2. 2
      iguana/exchanges/LP_rpc.c
  3. 2
      iguana/exchanges/LP_socket.c
  4. 6
      iguana/exchanges/LP_utxo.c
  5. 6
      iguana/exchanges/LP_utxos.c

2
iguana/exchanges/LP_include.h

@ -305,7 +305,7 @@ int32_t LP_mempoolscan(char *symbol,bits256 searchtxid);
int32_t LP_txheight(struct iguana_info *coin,bits256 txid);
int32_t LP_address_utxoadd(struct iguana_info *coin,char *coinaddr,bits256 txid,int32_t vout,uint64_t value,int32_t height,int32_t spendheight);
cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrumret);
void LP_postutxos(char *symbol);
void LP_postutxos(char *symbol,char *coinaddr);
uint16_t LP_randpeer(char *destip);

2
iguana/exchanges/LP_rpc.c

@ -459,7 +459,7 @@ void LP_listunspent_issue(char *symbol,char *coinaddr)
{
if ( electrum_process_array(coin,coinaddr,retjson) != 0 )
{
LP_postutxos(symbol); // might be good to not saturate
LP_postutxos(symbol,coinaddr); // might be good to not saturate
}
}
//printf("rand %s listunspent.(%s) to %s:%u -> %s\n",symbol,coinaddr,destip,destport,retstr);

2
iguana/exchanges/LP_socket.c

@ -470,7 +470,7 @@ cJSON *electrum_address_listunspent(char *symbol,struct electrum_info *ep,cJSON
{
//printf("%s %s LISTUNSPENT.(%s)\n",symbol,addr,jprint(retjson,0));
if ( electrum_process_array(coin,addr,retjson) != 0 )
LP_postutxos(coin->symbol);
LP_postutxos(coin->symbol,addr);
safecopy(coin->lastunspent,addr,sizeof(coin->lastunspent));
coin->unspenttime = (uint32_t)time(NULL);
}

6
iguana/exchanges/LP_utxo.c

@ -217,10 +217,10 @@ cJSON *LP_address_utxos(struct iguana_info *coin,char *coinaddr,int32_t electrum
return(array);
}
void LP_postutxos(char *symbol)
void LP_postutxos(char *symbol,char *coinaddr)
{
bits256 zero; char *msg; struct iguana_info *coin; cJSON *array,*reqjson = cJSON_CreateObject();
if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coin->smartaddr,1)) != 0 )
if ( (coin= LP_coinfind(symbol)) != 0 && (array= LP_address_utxos(coin,coinaddr,1)) != 0 )
{
//printf("LP_postutxos pubsock.%d %s %s\n",pubsock,symbol,coin->smartaddr);
if ( cJSON_GetArraySize(array) == 0 )
@ -230,7 +230,7 @@ void LP_postutxos(char *symbol)
memset(zero.bytes,0,sizeof(zero));
jaddstr(reqjson,"method","postutxos");
jaddstr(reqjson,"coin",symbol);
jaddstr(reqjson,"coinaddr",coin->smartaddr);
jaddstr(reqjson,"coinaddr",coinaddr);
jadd(reqjson,"utxos",array);
msg = jprint(reqjson,1);
printf("post (%s) -> %d\n",msg,LP_mypubsock);

6
iguana/exchanges/LP_utxos.c

@ -789,7 +789,7 @@ int32_t LP_privkey_init(int32_t mypubsock,struct iguana_info *coin,bits256 mypri
}
free_json(array);
if ( flag != 0 )
LP_postutxos(coin->symbol);
LP_postutxos(coin->symbol,coin->smartaddr);
}
//printf("privkey.%s %.8f\n",symbol,dstr(total));
return(flag);
@ -909,8 +909,8 @@ void LP_privkey_updates(void *ctx,int32_t pubsock,char *passphrase,int32_t inito
privkey = LP_privkeycalc(ctx,pubkey33,&pubkey,coin,passphrase,"");
if ( coin->inactive == 0 && initonly == 0 )
{
if ( LP_privkey_init(pubsock,coin,privkey,pubkey) > 0 || (rand() % 10) == 0 )
LP_postutxos(coin->symbol);
if ( LP_privkey_init(pubsock,coin,privkey,pubkey) == 0 && (rand() % 10) == 0 )
LP_postutxos(coin->symbol,coin->smartaddr);
}
}
}

Loading…
Cancel
Save