Remove unused code

This commit is contained in:
Duke
2025-08-08 18:02:25 -04:00
parent e495bf35b2
commit 15b4378ff3
2 changed files with 1 additions and 119 deletions

View File

@@ -18,7 +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);
@@ -41,39 +40,9 @@ struct pax_transaction *hush_paxfind(uint256 txid,uint16_t vout,uint8_t type)
return(pax);
}
struct pax_transaction *hush_paxfinds(uint256 txid,uint16_t vout)
{
struct pax_transaction *pax; int32_t i; uint8_t types[] = { 'I', 'D', 'X', 'A', 'W' };
for (i=0; i<sizeof(types)/sizeof(*types); i++)
if ( (pax= hush_paxfind(txid,vout,types[i])) != 0 )
return(pax);
return(0);
}
struct pax_transaction *hush_paxmark(int32_t height,uint256 txid,uint16_t vout,uint8_t type,int32_t mark)
{
struct pax_transaction *pax; uint8_t buf[35];
pthread_mutex_lock(&hush_mutex);
pax_keyset(buf,txid,vout,type);
HASH_FIND(hh,PAX,buf,sizeof(buf),pax);
if ( pax == 0 )
{
pax = (struct pax_transaction *)calloc(1,sizeof(*pax));
pax->txid = txid;
pax->vout = vout;
pax->type = type;
memcpy(pax->buf,buf,sizeof(pax->buf));
HASH_ADD_KEYPTR(hh,PAX,pax->buf,sizeof(pax->buf),pax);
//printf("ht.%d create pax.%p mark.%d\n",height,pax,mark);
}
if ( pax != 0 )
{
pax->marked = mark;
//if ( height > 214700 || pax->height > 214700 )
// printf("mark ht.%d %.8f %.8f\n",pax->height,dstr(pax->puposhis),dstr(pax->fiatoshis));
}
pthread_mutex_unlock(&hush_mutex);
struct pax_transaction *pax;
return(pax);
}
@@ -105,71 +74,6 @@ uint64_t hush_paxtotal()
return(0);
}
static int _paxorder(const void *a,const void *b)
{
#define pax_a (*(struct pax_transaction **)a)
#define pax_b (*(struct pax_transaction **)b)
uint64_t aval,bval;
aval = pax_a->fiatoshis + pax_a->puposhis + pax_a->height;
bval = pax_b->fiatoshis + pax_b->puposhis + pax_b->height;
if ( bval > aval )
return(-1);
else if ( bval < aval )
return(1);
return(0);
#undef pax_a
#undef pax_b
}
int32_t hush_pending_withdraws(char *opretstr) // todo: enforce deterministic order
{
struct pax_transaction *pax,*pax2,*tmp,*paxes[64]; uint8_t opretbuf[16384*4]; int32_t i,n,ht,len=0; uint64_t total = 0;
if ( HUSH_PAX == 0 || HUSH_PASSPORT_INITDONE == 0 )
return(0);
if ( hush_isrealtime(&ht) == 0 || SMART_CHAIN_SYMBOL[0] != 0 )
return(0);
n = 0;
HASH_ITER(hh,PAX,pax,tmp)
{
if ( pax->type == 'W' )
{
if ( (pax2= hush_paxfind(pax->txid,pax->vout,'A')) != 0 )
{
if ( pax2->approved != 0 )
pax->approved = pax2->approved;
}
else if ( (pax2= hush_paxfind(pax->txid,pax->vout,'X')) != 0 )
pax->approved = pax->height;
//printf("pending_withdraw: pax %s marked.%u approved.%u validated.%llu\n",pax->symbol,pax->marked,pax->approved,(long long)pax->validated);
if ( pax->marked == 0 && pax->approved == 0 && pax->validated != 0 )
{
if ( n < sizeof(paxes)/sizeof(*paxes) )
{
paxes[n++] = pax;
//int32_t j; for (j=0; j<32; j++)
// printf("%02x",((uint8_t *)&pax->txid)[j]);
//printf(" %s.(ht.%d ht.%d marked.%u approved.%d validated %.8f) %.8f\n",pax->source,pax->height,pax->otherheight,pax->marked,pax->approved,dstr(pax->validated),dstr(pax->puposhis));
}
}
}
}
opretstr[0] = 0;
if ( n > 0 )
{
opretbuf[len++] = 'A';
qsort(paxes,n,sizeof(*paxes),_paxorder);
for (i=0; i<n; i++)
{
if ( len < (sizeof(opretbuf)>>3)*7 )
len += hush_rwapproval(1,&opretbuf[len],paxes[i]);
}
if ( len > 0 )
init_hexbytes_noT(opretstr,opretbuf,len);
}
//fprintf(stderr,"hush_pending_withdraws len.%d PAXTOTAL %.8f\n",len,dstr(hush_paxtotal()));
return(len);
}
int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t tokomodo)
{
return(0);
@@ -932,26 +836,8 @@ extern std::vector<uint8_t> Mineropret; // opreturn data set by the data gatheri
#define issue_curl(cmdstr) bitcoind_RPC(0,(char *)"CBCOINBASE",cmdstr,0,0,0)
struct hush_extremeprice
{
uint256 blockhash;
uint32_t pricebits,timestamp;
int32_t height;
int16_t dir,ind;
} ExtremePrice;
struct hush_priceinfo
{
FILE *fp;
char symbol[64];
} PRICES[HUSH_MAXPRICES];
int32_t hush_cbopretsize(uint64_t flags);
void hush_PriceCache_shift()
{
}
int32_t _hush_heightpricebits(uint64_t *seedp,uint32_t *heightbits,CBlock *block)
{
return(-1);
@@ -1128,7 +1014,6 @@ cJSON *send_curl(char *url,char *fname)
}
// get_urljson just returns the JSON returned by the URL using issue_curl
cJSON *get_urljson(char *url)
{
char *jsonstr; cJSON *json = 0;

View File

@@ -1055,9 +1055,6 @@ UniValue notaries(const UniValue& params, bool fHelp, const CPubKey& mypk)
return ret;
}
int32_t hush_pending_withdraws(char *opretstr);
extern char CURRENCIES[][8];
UniValue gettxout(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
if (fHelp || params.size() < 2 || params.size() > 3)