|
|
@ -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 ) |
|
|
|