Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
f21b8596df
  1. 1
      iguana/SuperNET.c
  2. 3
      iguana/SuperNET.h
  3. 15
      iguana/SuperNET_category.c

1
iguana/SuperNET.c

@ -954,6 +954,7 @@ bits256 SuperNET_pindecipher(IGUANA_ARGS,char *pin,char *privcipher)
{
cJSON *testjson; char *mstr,*cstr; bits256 privkey,pinpriv,pinpub;
conv_NXTpassword(pinpriv.bytes,pinpub.bytes,(uint8_t *)pin,(int32_t)strlen(pin));
privkey = GENESIS_PRIVKEY;
if ( (cstr= SuperNET_decipher(IGUANA_CALLARGS,pinpriv,pinpub,privcipher)) != 0 )
{
if ( (testjson= cJSON_Parse(cstr)) != 0 )

3
iguana/SuperNET.h

@ -99,7 +99,8 @@ struct category_info
UT_hash_handle hh; queue_t Q;
int32_t (*process_func)(struct supernet_info *myinfo,void *data,int32_t datalen,char *remoteaddr);
int32_t (*blockhash_func)(void *blockhashp,void *data,int32_t datalen); // returns len of blockhash
uint64_t (*stakehit_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 addr);
uint64_t (*hit_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 addr);
int32_t (*ishwm_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 blockhash,int32_t heighthint,uint64_t hwmwt,uint64_t prevwt,uint64_t hit);
bits256 hash; void *info; struct category_info *sub;
};
extern struct category_info *Categories;

15
iguana/SuperNET_category.c

@ -96,12 +96,23 @@ struct category_info *category_blockhashfunc(bits256 categoryhash,bits256 subhas
return(0);
}
struct category_info *category_stakehitfunc(bits256 categoryhash,bits256 subhash,uint64_t (*stakehit_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 addr))
struct category_info *category_hitfunc(bits256 categoryhash,bits256 subhash,uint64_t (*hit_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 addr))
{
struct category_info *cat;
if ( (cat= category_find(categoryhash,subhash)) != 0 )
{
cat->stakehit_func = stakehit_func;
cat->hit_func = hit_func;
return(cat);
}
return(0);
}
struct category_info *category_ishwmfunc(bits256 categoryhash,bits256 subhash,int32_t (*ishwm_func)(struct supernet_info *myinfo,void *categoryinfo,void *subinfo,bits256 blockhash,int32_t heighthint,uint64_t hwmwt,uint64_t prevwt,uint64_t hit))
{
struct category_info *cat;
if ( (cat= category_find(categoryhash,subhash)) != 0 )
{
cat->ishwm_func = ishwm_func;
return(cat);
}
return(0);

Loading…
Cancel
Save