diff --git a/iguana/SuperNET.c b/iguana/SuperNET.c index 1b71f1e23..994563896 100644 --- a/iguana/SuperNET.c +++ b/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 ) diff --git a/iguana/SuperNET.h b/iguana/SuperNET.h index 86b8513fc..d9bf8b2ad 100644 --- a/iguana/SuperNET.h +++ b/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; diff --git a/iguana/SuperNET_category.c b/iguana/SuperNET_category.c index 6f53c70ee..ff409af9f 100644 --- a/iguana/SuperNET_category.c +++ b/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);