jl777 8 years ago
parent
commit
23dabc8289
  1. 2
      basilisk/basilisk_CMD.c
  2. 10
      basilisk/basilisk_bitcoin.c
  3. 2
      iguana/tests/rawtx6

2
basilisk/basilisk_CMD.c

@ -141,6 +141,8 @@ void basilisk_request_goodbye(struct supernet_info *myinfo)
char *basilisk_respond_addrelay(struct supernet_info *myinfo,char *CMD,void *addr,char *remoteaddr,uint32_t basilisktag,cJSON *valsobj,uint8_t *data,int32_t datalen,bits256 hash,int32_t from_basilisk)
{
char *ipaddr,*retstr=0;
if ( valsobj == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
if ( (ipaddr= jstr(valsobj,"ipaddr")) != 0 )
retstr = basilisk_addrelay_info(myinfo,0,(uint32_t)calc_ipbits(ipaddr),jbits256(valsobj,"pubkey"));
else retstr = clonestr("{\"error\":\"need rmd160, address and ipaddr\"}");

10
basilisk/basilisk_bitcoin.c

@ -383,6 +383,8 @@ double basilisk_bitcoin_valuemetric(struct supernet_info *myinfo,struct basilisk
void *basilisk_bitcoinvalue(struct basilisk_item *Lptr,struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj)
{
int32_t i,height,vout,numsent; struct basilisk_item *ptr; char coinaddr[64],str[65]; struct basilisk_value *v; uint64_t value = 0; bits256 txid; struct iguana_outpoint outpt;
if ( valsobj == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
if ( myinfo->IAMNOTARY != 0 && myinfo->NOTARY.RELAYID >= 0 )
return(0);
txid = jbits256(valsobj,"txid");
@ -424,6 +426,8 @@ void *basilisk_bitcoinvalue(struct basilisk_item *Lptr,struct supernet_info *myi
void *basilisk_getinfo(struct basilisk_item *Lptr,struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj)
{
struct basilisk_item *ptr; cJSON *infojson; int32_t numsent,fanout,numrequired;
if ( valsobj == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
if ( (myinfo->IAMNOTARY != 0 || myinfo->NOTARY.RELAYID >= 0) && strcmp(coin->symbol,"NOTARY") != 0 )
return(0);
if ( coin->VALIDATENODE != 0 || coin->FULLNODE != 0 )
@ -516,6 +520,8 @@ int32_t basilisk_vins_validate(struct supernet_info *myinfo,struct iguana_info *
char *basilisk_bitcoinrawtx(struct supernet_info *myinfo,struct iguana_info *coin,char *remoteaddr,uint32_t basilisktag,int32_t timeoutmillis,cJSON *valsobj)
{
uint8_t buf[4096]; int32_t oplen,offset,minconf,spendlen; cJSON *vins,*addresses,*txobj = 0; uint32_t locktime; char *opreturn,*spendscriptstr,*changeaddr,*rawtx = 0; int64_t amount,txfee,burnamount;
if ( valsobj == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
if ( myinfo->IAMNOTARY != 0 || myinfo->NOTARY.RELAYID >= 0 )
return(clonestr("{\"error\":\"special relays only do OUT and MSG\"}"));
vins = 0;
@ -815,6 +821,8 @@ cJSON *BTC_makeclaimfunc(struct supernet_info *myinfo,struct exchange_info *exch
HASH_ARRAY_STRING(basilisk,value,hash,vals,hexstr)
{
char *retstr=0,*symbol; uint32_t basilisktag; struct basilisk_item *ptr,Lptr; int32_t timeoutmillis;
if ( vals == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
if ( myinfo->IAMNOTARY != 0 || myinfo->NOTARY.RELAYID >= 0 )
return(clonestr("{\"error\":\"special relays only do OUT and MSG\"}"));
//if ( coin == 0 )
@ -843,6 +851,8 @@ HASH_ARRAY_STRING(basilisk,value,hash,vals,hexstr)
HASH_ARRAY_STRING(basilisk,rawtx,hash,vals,hexstr)
{
char *retstr=0,*symbol; uint32_t basilisktag; int32_t timeoutmillis,i,retval = -1; uint64_t amount,txfee; cJSON *retarray;
if ( vals == 0 )
return(clonestr("{\"error\":\"null valsobj\"}"));
//if ( coin == 0 )
{
if ( (symbol= jstr(vals,"symbol")) != 0 || (symbol= jstr(vals,"coin")) != 0 )

2
iguana/tests/rawtx6

@ -1 +1 @@
curl --url "http://127.0.0.1:7778" --data "{\"method\":\"rawtx\",\"agent\":\"basilisk\",\"addresses\":[\"19pE1sb6hPbV5644Fud6u7voNeKPfmfP3Y\", \"17SuJzHEuLzBtyHe83sYDjQFq2HeczRA1b\", \"1DyCyE5f4wCT9vBNUrCshg3ZkF7C9hT5wK\", \"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\", \"1APJX58afkt2A25SmPQb9TrzGHbYYHLiVu\", \"12KFXEJ9C6VmvFabj4uqKeLYLm4XMsATU1\", \"12qDPNmMXez9r8CiHaww9dJooUk8AZSueF\", \"1DM9PDaBkYU27fB9ZQipZtGJtfBakpuYDv\", \"1HiTUabo7ruYY3NbxiDZi9dpnb5t4K6AqD\", \"1Q1thfWmTTwkR1yWEUHytrKcU6uGU8gUTu\", \"187ozeW6E1pbsQYvw5yqU6kzros5uXKcZk\", \"1FtJpcQ7q9msxYwR8QpF92bZDmGzVNHpxo\", \"1KDeCZiFXuNtpARcwEwohKJJb3Yeyjy8Ui\"],\"coin\":\"SYS\",\"changeaddr\":\"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\",\"spendscript\":\"76a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88ac\",\"satoshis\":\"10000\",\"txfee\":\"10000\",\"minconf\":2,\"basilisktag\":995811301,\"locktime\":0,\"timeout\":30000}"
curl --url "http://127.0.0.1:7778" --data "{\"method\":\"rawtx\",\"agent\":\"basilisk\",\"vals\":{\"addresses\":[\"19pE1sb6hPbV5644Fud6u7voNeKPfmfP3Y\", \"17SuJzHEuLzBtyHe83sYDjQFq2HeczRA1b\", \"1DyCyE5f4wCT9vBNUrCshg3ZkF7C9hT5wK\", \"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\", \"1APJX58afkt2A25SmPQb9TrzGHbYYHLiVu\", \"12KFXEJ9C6VmvFabj4uqKeLYLm4XMsATU1\", \"12qDPNmMXez9r8CiHaww9dJooUk8AZSueF\", \"1DM9PDaBkYU27fB9ZQipZtGJtfBakpuYDv\", \"1HiTUabo7ruYY3NbxiDZi9dpnb5t4K6AqD\", \"1Q1thfWmTTwkR1yWEUHytrKcU6uGU8gUTu\", \"187ozeW6E1pbsQYvw5yqU6kzros5uXKcZk\", \"1FtJpcQ7q9msxYwR8QpF92bZDmGzVNHpxo\", \"1KDeCZiFXuNtpARcwEwohKJJb3Yeyjy8Ui\"],\"coin\":\"SYS\",\"changeaddr\":\"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\",\"spendscript\":\"76a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88ac\",\"satoshis\":\"10000\",\"txfee\":\"10000\",\"minconf\":2},\"basilisktag\":995811301,\"locktime\":0,\"timeout\":30000}"

Loading…
Cancel
Save