Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7b4d4dfe9b
  1. 1
      iguana/iguana777.h
  2. 10
      iguana/iguana_instantdex.c
  3. 8
      iguana/iguana_payments.c
  4. 13
      iguana/iguana_recv.c

1
iguana/iguana777.h

@ -977,6 +977,7 @@ char *iguana_signunspents(struct supernet_info *myinfo,struct iguana_info *coin,
bits256 iguana_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *coin,char *signedtx);
int32_t iguana_inv2packet(uint8_t *serialized,int32_t maxsize,int32_t type,bits256 *hashes,int32_t n);
int32_t instantdex_inv2data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct exchange_info *exchange);
void instantdex_recvquote(struct iguana_info *coin,struct iguana_peer *addr,bits256 encodedhash);
extern int32_t HDRnet,netBLOCKS;

10
iguana/iguana_instantdex.c

@ -693,7 +693,7 @@ struct bitcoin_swapinfo *instantdex_statemachinefind(struct supernet_info *myinf
return(retswap);
}
struct instantdex_accept *instantdex_offerfind(struct supernet_info *myinfo,struct exchange_info *exchange,cJSON *bids,cJSON *asks,uint64_t orderid,char *base,char *rel,int32_t requeue)
struct instantdex_accept *instantdex_offerfind(struct supernet_info *ignore,struct exchange_info *exchange,cJSON *bids,cJSON *asks,uint64_t orderid,char *base,char *rel,int32_t requeue)
{
struct instantdex_accept PAD,*ap,*retap = 0; uint32_t now; cJSON *item,*offerobj; char *type;
if ( exchange == 0 )
@ -826,6 +826,14 @@ struct instantdex_accept *instantdex_quotefind(struct supernet_info *myinfo,stru
return(instantdex_offerfind(myinfo,exchanges777_find("bitcoin"),0,0,orderid,base,rel,1));
}
void instantdex_recvquote(struct iguana_info *coin,struct iguana_peer *addr,bits256 encodedhash)
{
if ( instantdex_quotefind(0,coin,addr,encodedhash) == 0 )
{
}
}
int32_t instantdex_quoterequest(struct supernet_info *myinfo,struct iguana_info *coin,uint8_t *serialized,int32_t maxlen,struct iguana_peer *addr,bits256 encodedhash)
{
struct instantdex_accept *ap; int32_t olen; bits256 orderhash;

8
iguana/iguana_payments.c

@ -150,9 +150,11 @@ cJSON *iguana_scriptobj(struct iguana_info *coin,uint8_t rmd160[20],char *coinad
for (i=0; i<V.N; i++)
jaddistr(addrobj,V.signers[i].coinaddr);
jadd(scriptobj,"addresses",addrobj);
if ( V.p2shlen != 0 )
jaddstr(scriptobj,"p2sh",V.coinaddr);
strcpy(coinaddr,V.coinaddr);
if ( scriptlen != 0 )
{
bitcoin_address(coinaddr,coin->chain->p2shtype,script,scriptlen);
jaddstr(scriptobj,"p2sh",coinaddr);
}
memcpy(rmd160,V.rmd160,20);
}
return(scriptobj);

13
iguana/iguana_recv.c

@ -1110,6 +1110,14 @@ struct iguana_bundlereq *iguana_recvtxids(struct iguana_info *coin,struct iguana
return(req);
}
struct iguana_bundlereq *iguana_recvquotes(struct iguana_info *coin,struct iguana_bundlereq *req,bits256 *quotes,int32_t n)
{
int32_t i;
for (i=0; i<n; i++)
instantdex_recvquote(coin,req->addr,quotes[i]);
return(req);
}
struct iguana_bundlereq *iguana_recvunconfirmed(struct iguana_info *coin,struct iguana_bundlereq *req,uint8_t *data,int32_t datalen)
{
int32_t i;
@ -1306,6 +1314,11 @@ int32_t iguana_processrecvQ(struct iguana_info *coin,int32_t *newhwmp) // single
if ( (req= iguana_recvtxids(coin,req,req->hashes,req->n)) != 0 )
myfree(req->hashes,(req->n+1) * sizeof(*req->hashes)), req->hashes = 0;
}
else if ( req->type == 'Q' ) // quotes from inv
{
if ( (req= iguana_recvquotes(coin,req,req->hashes,req->n)) != 0 )
myfree(req->hashes,(req->n+1) * sizeof(*req->hashes)), req->hashes = 0;
}
else printf("iguana_updatebundles unknown type.%c\n",req->type);//, getchar();
//fprintf(stderr,"finished coin->recvQ\n");
if ( req != 0 )

Loading…
Cancel
Save