hush_baseid
This commit is contained in:
@@ -32,7 +32,7 @@ int32_t pax_fiatstatus(uint64_t *available,uint64_t *deposited,uint64_t *issued,
|
||||
{
|
||||
int32_t baseid; struct hush_state *sp; int64_t netliability,maxallowed,maxval;
|
||||
*available = *deposited = *issued = *withdrawn = *approved = *redeemed = 0;
|
||||
if ( (baseid= komodo_baseid(base)) >= 0 )
|
||||
if ( (baseid= hush_baseid(base)) >= 0 )
|
||||
{
|
||||
if ( (sp= hush_stateptrget(base)) != 0 )
|
||||
{
|
||||
@@ -241,7 +241,7 @@ int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t
|
||||
kmdheights[n] = p.height;
|
||||
otherheights[n] = p.otherheight;
|
||||
memcpy(&rmd160s[n * 20],p.rmd160,20);
|
||||
baseids[n] = komodo_baseid(p.source);
|
||||
baseids[n] = hush_baseid(p.source);
|
||||
if ( 0 )
|
||||
{
|
||||
char coinaddr[64];
|
||||
@@ -261,7 +261,7 @@ int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t
|
||||
}
|
||||
vouts[n] = opretbuf[len++];
|
||||
vouts[n] = (opretbuf[len++] << 8) | vouts[n];
|
||||
baseids[n] = komodo_baseid(base);
|
||||
baseids[n] = hush_baseid(base);
|
||||
if ( (pax= komodo_paxfinds(txids[n],vouts[n])) != 0 )
|
||||
{
|
||||
values[n] = (strcmp("KMD",base) == 0) ? pax->komodoshis : pax->fiatoshis;
|
||||
@@ -483,7 +483,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
|
||||
struct hush_state *kmdsp = hush_stateptrget((char *)"KMD");
|
||||
sp = hush_stateptr(symbol,dest);
|
||||
strcpy(symbol,base);
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && komodo_baseid(SMART_CHAIN_SYMBOL) < 0 )
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && hush_baseid(SMART_CHAIN_SYMBOL) < 0 )
|
||||
return(0);
|
||||
PENDING_HUSH_TX = 0;
|
||||
for (i=0; i<3; i++)
|
||||
@@ -556,7 +556,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
|
||||
{
|
||||
if ( kmdsp != 0 )
|
||||
{
|
||||
if ( (baseid= komodo_baseid(pax->symbol)) < 0 || ((1LL << baseid) & sp->RTmask) == 0 )
|
||||
if ( (baseid= hush_baseid(pax->symbol)) < 0 || ((1LL << baseid) & sp->RTmask) == 0 )
|
||||
{
|
||||
printf("not RT for (%s) %llx baseid.%d %llx\n",pax->symbol,(long long)sp->RTmask,baseid,(long long)(1LL<<baseid));
|
||||
continue;
|
||||
@@ -832,7 +832,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
||||
{
|
||||
uint8_t rmd160[20],rmd160s[64*20],addrtype,shortflag,pubkey33[33]; int32_t didstats,i,j,n,kvheight,len,tokomodo,kmdheight,otherheights[64],kmdheights[64]; int8_t baseids[64]; char base[4],coinaddr[64],destaddr[64]; uint256 txids[64]; uint16_t vouts[64]; uint64_t convtoshis,seed; int64_t fee,fiatoshis,komodoshis,checktoshis,values[64],srcvalues[64]; struct pax_transaction *pax,*pax2; struct hush_state *basesp; double diff;
|
||||
const char *typestr = "unknown";
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && komodo_baseid(SMART_CHAIN_SYMBOL) < 0 && opretbuf[0] != 'K' )
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && hush_baseid(SMART_CHAIN_SYMBOL) < 0 && opretbuf[0] != 'K' )
|
||||
{
|
||||
//printf("komodo_opreturn skip %s\n",SMART_CHAIN_SYMBOL);
|
||||
return("assetchain");
|
||||
@@ -991,7 +991,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
||||
}
|
||||
else if ( height < 236000 && opretbuf[0] == 'W' && strncmp(SMART_CHAIN_SYMBOL,(char *)&opretbuf[opretlen-4],3) == 0 )//&& opretlen >= 38 )
|
||||
{
|
||||
if ( komodo_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(SMART_CHAIN_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )
|
||||
if ( hush_baseid((char *)&opretbuf[opretlen-4]) >= 0 && strcmp(SMART_CHAIN_SYMBOL,(char *)&opretbuf[opretlen-4]) == 0 )
|
||||
{
|
||||
for (i=0; i<opretlen; i++)
|
||||
printf("%02x",opretbuf[i]);
|
||||
@@ -1058,7 +1058,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
|
||||
//printf("baseids[%d] %d\n",i,baseids[i]);
|
||||
if ( (pax= komodo_paxfind(txids[i],vouts[i],'W')) != 0 || (pax= komodo_paxfind(txids[i],vouts[i],'X')) != 0 )
|
||||
{
|
||||
baseids[i] = komodo_baseid(pax->symbol);
|
||||
baseids[i] = hush_baseid(pax->symbol);
|
||||
printf("override neg1 with (%s)\n",pax->symbol);
|
||||
}
|
||||
if ( baseids[i] < 0 )
|
||||
@@ -1444,7 +1444,7 @@ void hush_passport_iteration()
|
||||
limit = 10000000;
|
||||
} else {
|
||||
limit = 10000000;
|
||||
refid = komodo_baseid(SMART_CHAIN_SYMBOL)+1; // illegal base -> baseid.-1 -> 0
|
||||
refid = hush_baseid(SMART_CHAIN_SYMBOL)+1; // illegal base -> baseid.-1 -> 0
|
||||
if ( refid == 0 )
|
||||
{
|
||||
HUSH_PASSPORT_INITDONE = 1;
|
||||
|
||||
@@ -111,7 +111,7 @@ char CURRENCIES[][8] = { "USD", "EUR", "JPY", "GBP", "AUD", "CAD", "CHF", "NZD",
|
||||
"CNY", "RUB", "MXN", "BRL", "INR", "HKD", "TRY", "ZAR", "PLN", "NOK", "SEK", "DKK", "CZK", "HUF", "ILS", "KRW", "MYR", "PHP", "RON", "SGD", "THB", "BGN", "IDR", "HRK",
|
||||
"KMD" };
|
||||
|
||||
int32_t komodo_baseid(char *origbase)
|
||||
int32_t hush_baseid(char *origbase)
|
||||
{
|
||||
int32_t i; char base[64];
|
||||
for (i=0; origbase[i]!=0&&i<sizeof(base); i++)
|
||||
@@ -132,7 +132,7 @@ uint64_t hush_current_supply(uint32_t nHeight)
|
||||
uint64_t cur_money;
|
||||
int32_t baseid;
|
||||
|
||||
//if ( (baseid = komodo_baseid(SMART_CHAIN_SYMBOL)) >= 0 && baseid < 32 )
|
||||
//if ( (baseid = hush_baseid(SMART_CHAIN_SYMBOL)) >= 0 && baseid < 32 )
|
||||
// cur_money = ASSETCHAINS_GENESISTXVAL + ASSETCHAINS_SUPPLY + nHeight * ASSETCHAINS_REWARD[0] / SATOSHIDEN;
|
||||
//else
|
||||
{
|
||||
|
||||
@@ -502,7 +502,7 @@ uint64_t _komodo_paxprice(uint64_t *kmdbtcp,uint64_t *btcusdp,int32_t height,cha
|
||||
int32_t baseid=-1,relid=-1,i; uint32_t *ptr,*pvals;
|
||||
if ( height > 10 )
|
||||
height -= 10;
|
||||
if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 )
|
||||
if ( (baseid= hush_baseid(base)) >= 0 && (relid= hush_baseid(rel)) >= 0 )
|
||||
{
|
||||
//portable_mutex_lock(&komodo_mutex);
|
||||
for (i=NUM_PRICES-1; i>=0; i--)
|
||||
@@ -607,7 +607,7 @@ uint64_t _komodo_paxpriceB(uint64_t seed,int32_t height,char *base,char *rel,uin
|
||||
|
||||
uint64_t komodo_paxpriceB(uint64_t seed,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||
{
|
||||
uint64_t baseusd,basekmd,usdkmd; int32_t baseid = komodo_baseid(base);
|
||||
uint64_t baseusd,basekmd,usdkmd; int32_t baseid = hush_baseid(base);
|
||||
if ( height >= 236000 && strcmp(rel,"kmd") == 0 )
|
||||
{
|
||||
usdkmd = _komodo_paxpriceB(seed,height,(char *)"USD",(char *)"KMD",SATOSHIDEN);
|
||||
@@ -623,7 +623,7 @@ uint64_t komodo_paxpriceB(uint64_t seed,int32_t height,char *base,char *rel,uint
|
||||
|
||||
/*uint64_t komodo_paxpriceB(uint64_t seed,int32_t height,char *base,char *rel,uint64_t basevolume)
|
||||
{
|
||||
uint64_t baseusd,basekmd,usdkmd; int32_t baseid = komodo_baseid(base);
|
||||
uint64_t baseusd,basekmd,usdkmd; int32_t baseid = hush_baseid(base);
|
||||
//if ( strcmp(rel,"KMD") != 0 || baseid < 0 || MINDENOMS[baseid] == MINDENOMS[USD] )
|
||||
// return(_komodo_paxpriceB(seed,height,base,rel,basevolume));
|
||||
//else
|
||||
@@ -692,7 +692,7 @@ uint64_t komodo_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uin
|
||||
int32_t komodo_paxprices(int32_t *heights,uint64_t *prices,int32_t max,char *base,char *rel)
|
||||
{
|
||||
int32_t baseid=-1,relid=-1,i,num = 0; uint32_t *ptr;
|
||||
if ( (baseid= komodo_baseid(base)) >= 0 && (relid= komodo_baseid(rel)) >= 0 )
|
||||
if ( (baseid= hush_baseid(base)) >= 0 && (relid= hush_baseid(rel)) >= 0 )
|
||||
{
|
||||
for (i=NUM_PRICES-1; i>=0; i--)
|
||||
{
|
||||
@@ -726,7 +726,7 @@ uint64_t PAX_fiatdest(uint64_t *seedp,int32_t tokomodo,char *destaddr,uint8_t pu
|
||||
{
|
||||
uint8_t shortflag = 0; char base[4]; int32_t i,baseid; uint8_t addrtype,rmd160[20]; int64_t komodoshis = 0;
|
||||
*seedp = komodo_seed(height);
|
||||
if ( (baseid= komodo_baseid(origbase)) < 0 || baseid == MAX_CURRENCIES )
|
||||
if ( (baseid= hush_baseid(origbase)) < 0 || baseid == MAX_CURRENCIES )
|
||||
{
|
||||
if ( 0 && origbase[0] != 0 )
|
||||
printf("[%s] PAX_fiatdest illegal base.(%s)\n",SMART_CHAIN_SYMBOL,origbase);
|
||||
|
||||
@@ -811,7 +811,7 @@ char *bitcoin_address(char *coinaddr,uint8_t addrtype,uint8_t *pubkey_or_rmd160,
|
||||
|
||||
int32_t komodo_is_issuer()
|
||||
{
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && komodo_baseid(SMART_CHAIN_SYMBOL) >= 0 )
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 && hush_baseid(SMART_CHAIN_SYMBOL) >= 0 )
|
||||
return(1);
|
||||
else return(0);
|
||||
}
|
||||
@@ -2304,7 +2304,7 @@ void hush_args(char *argv0)
|
||||
|
||||
MAX_MONEY = hush_max_money();
|
||||
|
||||
if ( (baseid = komodo_baseid(SMART_CHAIN_SYMBOL)) >= 0 && baseid < 32 )
|
||||
if ( (baseid = hush_baseid(SMART_CHAIN_SYMBOL)) >= 0 && baseid < 32 )
|
||||
{
|
||||
//komodo_maxallowed(baseid);
|
||||
if(fDebug)
|
||||
@@ -2338,12 +2338,8 @@ void hush_args(char *argv0)
|
||||
//fprintf(stderr,"Got datadir.(%s)\n",dirname);
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 )
|
||||
{
|
||||
int32_t komodo_baseid(char *origbase);
|
||||
int32_t hush_baseid(char *origbase);
|
||||
extern int COINBASE_MATURITY;
|
||||
if ( strcmp(SMART_CHAIN_SYMBOL,"KMD") == 0 )
|
||||
{
|
||||
fprintf(stderr,"Oh hellz yezzz\n");
|
||||
}
|
||||
if ( (port= hush_userpass(ASSETCHAINS_USERPASS,SMART_CHAIN_SYMBOL)) != 0 )
|
||||
ASSETCHAINS_RPCPORT = port;
|
||||
else hush_configfile(SMART_CHAIN_SYMBOL,ASSETCHAINS_P2PPORT + 1);
|
||||
@@ -2465,7 +2461,7 @@ struct hush_state *hush_stateptrget(char *base)
|
||||
int32_t baseid;
|
||||
if ( base == 0 || base[0] == 0 || strcmp(base,(char *)"KYCSELLOUTS") == 0 )
|
||||
return(&HUSH_STATES[33]);
|
||||
else if ( (baseid= komodo_baseid(base)) >= 0 )
|
||||
else if ( (baseid= hush_baseid(base)) >= 0 )
|
||||
return(&HUSH_STATES[baseid+1]);
|
||||
else return(&HUSH_STATES[0]);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ uint32_t Mining_start,Mining_height;
|
||||
int32_t My_notaryid = -1;
|
||||
int32_t hush_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33,uint32_t timestamp);
|
||||
int32_t komodo_pax_opreturn(int32_t height,uint8_t *opret,int32_t maxsize);
|
||||
int32_t komodo_baseid(char *origbase);
|
||||
int32_t hush_baseid(char *origbase);
|
||||
int32_t hush_longestchain();
|
||||
int64_t hush_block_unlocktime(uint32_t nHeight);
|
||||
uint64_t the_commission(const CBlock *block,int32_t height);
|
||||
@@ -955,7 +955,7 @@ static bool ProcessBlockFound(CBlock* pblock)
|
||||
return true;
|
||||
}
|
||||
|
||||
int32_t komodo_baseid(char *origbase);
|
||||
int32_t hush_baseid(char *origbase);
|
||||
int32_t komodo_eligiblenotary(uint8_t pubkeys[66][33],int32_t *mids,uint32_t *blocktimes,int32_t *nonzpkeysp,int32_t height);
|
||||
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc);
|
||||
int32_t FOUND_BLOCK,HUSH_MAYBEMINED;
|
||||
@@ -1055,7 +1055,7 @@ void static BitcoinMiner()
|
||||
while ( (ASSETCHAIN_INIT == 0 || HUSH_INITDONE == 0) )
|
||||
{
|
||||
sleep(1);
|
||||
if ( komodo_baseid(SMART_CHAIN_SYMBOL) < 0 )
|
||||
if ( hush_baseid(SMART_CHAIN_SYMBOL) < 0 )
|
||||
break;
|
||||
}
|
||||
if ( SMART_CHAIN_SYMBOL[0] == 0 )
|
||||
|
||||
Reference in New Issue
Block a user