From fc8c641cfffa751f4e2ef065082ead59f766136d Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 8 Aug 2025 21:58:39 -0400 Subject: [PATCH] Remove unused code --- src/hush_defs.h | 10 ---- src/hush_gateway.h | 140 --------------------------------------------- 2 files changed, 150 deletions(-) diff --git a/src/hush_defs.h b/src/hush_defs.h index f60aad8df..37e496fae 100644 --- a/src/hush_defs.h +++ b/src/hush_defs.h @@ -556,12 +556,6 @@ static const char *notaries_list[NUM_HUSH_SEASONS][NUM_HUSH_NOTARIES][2] = #define HUSH_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) #define HUSH_VALUETOOBIG(x) ((x) > (uint64_t)10000000001*COIN) -//#ifndef TESTMODE -#define PRICES_DAYWINDOW ((3600*24/ASSETCHAINS_BLOCKTIME) + 1) -//#else -//#define PRICES_DAYWINDOW (7) -//#endif - extern uint8_t ASSETCHAINS_CLEARNET; extern uint8_t ASSETCHAINS_TXPOW,ASSETCHAINS_PUBLIC; extern int8_t ASSETCHAINS_ADAPTIVEPOW; @@ -623,12 +617,8 @@ int32_t hush_heightpricebits(uint64_t *seedp,uint32_t *heightbits,int32_t nHeigh char *hush_pricename(char *name,int32_t ind); int32_t hush_priceind(const char *symbol); int32_t hush_pricesinit(); -int64_t hush_priceave(int64_t *tmpbuf,int64_t *correlated,int32_t cskip); -int64_t hush_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int32_t rawskip,uint32_t *nonzprices,int32_t smoothwidth); int32_t hush_nextheight(); uint32_t hush_heightstamp(int32_t height); -int64_t hush_pricemult(int32_t ind); -int32_t hush_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks); int32_t hush_currentheight(); int32_t hush_notarized_bracket(struct notarized_checkpoint *nps[2],int32_t height); arith_uint256 hush_adaptivepow_target(int32_t height,arith_uint256 bnTarget,uint32_t nTime); diff --git a/src/hush_gateway.h b/src/hush_gateway.h index e303de226..a27b99927 100644 --- a/src/hush_gateway.h +++ b/src/hush_gateway.h @@ -18,11 +18,6 @@ // paxdeposit equivalent in reverse makes opreturn and HUSH does the same in reverse #include "hush_defs.h" -int32_t pax_fiatstatus(uint64_t *available,uint64_t *deposited,uint64_t *issued,uint64_t *withdrawn,uint64_t *approved,uint64_t *redeemed,char *base) -{ - return(-1); -} - void pax_keyset(uint8_t *buf,uint256 txid,uint16_t vout,uint8_t type) { memcpy(buf,&txid,32); @@ -79,15 +74,6 @@ int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t toko return(0); } -int32_t hush_checkvout(int32_t vout,int32_t k,int32_t indallvouts) -{ - if ( k < indallvouts ) - return(vout == 1); - else if ( k == indallvouts || k == indallvouts+1 ) - return(1); - else return(vout == 0); -} - void hush_passport_iteration(); const char *hush_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int32_t opretlen,uint256 txid,uint16_t vout,char *source) @@ -1026,136 +1012,15 @@ cJSON *get_urljson(char *url) return(json); } -// hush_cbopretupdate() obtains the external price data and encodes it into Mineropret, which will then be used by the miner and validation -// save history, use new data to approve past rejection, where is the auto-reconsiderblock? - int32_t hush_cbopretsize(uint64_t flags) { return 0; } -extern uint256 Queued_reconsiderblock; - void hush_cbopretupdate(int32_t forceflag) { } -int64_t hush_pricemult(int32_t ind) -{ - return(0); -} - -int64_t hush_pricecorrelated(uint64_t seed,int32_t ind,uint32_t *rawprices,int32_t rawskip,uint32_t *nonzprices,int32_t smoothwidth) -{ - return(0); -} - -int64_t _pairave64(int64_t valA,int64_t valB) -{ - if ( valA != 0 && valB != 0 ) - return((valA + valB) / 2); - else if ( valA != 0 ) return(valA); - else return(valB); -} - -int64_t _pairdiff64(register int64_t valA,register int64_t valB) -{ - if ( valA != 0 && valB != 0 ) - return(valA - valB); - else return(0); -} - -int64_t balanced_ave64(int64_t buf[],int32_t i,int32_t width) -{ - register int32_t nonz,j; register int64_t sum,price; - nonz = 0; - sum = 0; - for (j=-width; j<=width; j++) - { - price = buf[i + j]; - if ( price != 0 ) - { - sum += price; - nonz++; - } - } - if ( nonz != 0 ) - sum /= nonz; - return(sum); -} - -void buf_trioave64(int64_t dest[],int64_t src[],int32_t n) -{ - register int32_t i,j,width = 3; - for (i=0; i<128; i++) - src[i] = 0; - //for (i=n-width-1; i>width; i--) - // dest[i] = balanced_ave(src,i,width); - //for (i=width; i>0; i--) - // dest[i] = balanced_ave(src,i,i); - for (i=1; i *(int64_t *)b) return 1; - else if ( (uint64_t)a < (uint64_t)b ) // jl777 prevent nondeterminism - return(-1); - else return(1); -} - -static void sort64(int64_t *l, int32_t llen) -{ - qsort(l,llen,sizeof(uint64_t),cmp_llu); -} - -static int revcmp_llu(const void *a, const void*b) -{ - if(*(int64_t *)a < *(int64_t *)b) return 1; - else if(*(int64_t *)a > *(int64_t *)b) return -1; - else if ( (uint64_t)a < (uint64_t)b ) // jl777 prevent nondeterminism - return(-1); - else return(1); -} - -static void revsort64(int64_t *l, int32_t llen) -{ - qsort(l,llen,sizeof(uint64_t),revcmp_llu); -} - -int64_t hush_priceave(int64_t *buf,int64_t *correlated,int32_t cskip) -{ - return 0; -} - int32_t hush_pricesinit() { return(0); @@ -1164,8 +1029,3 @@ int32_t hush_pricesinit() void hush_pricesupdate(int32_t height,CBlock *pblock) { } - -int32_t hush_priceget(int64_t *buf64,int32_t ind,int32_t height,int32_t numblocks) -{ - return 0; -}