Browse Source

Cleanup

master^2
Duke Leto 3 years ago
parent
commit
4f15626bb0
  1. 4
      src/hush.h
  2. 4
      src/hush_bitcoind.h
  3. 24
      src/hush_ccdata.h
  4. 18
      src/hush_gateway.h
  5. 2
      src/hush_globals.h
  6. 8
      src/hush_notary.h
  7. 4
      src/hush_structs.h
  8. 16
      src/rpc/blockchain.cpp
  9. 12
      src/rpc/crosschain.cpp
  10. 5
      src/stratum.cpp
  11. 2
      src/zcash/JoinSplit.cpp

4
src/hush.h

@ -653,8 +653,8 @@ int32_t hush_voutupdate(bool fJustCheck,int32_t *isratificationp,int32_t notaryi
// MoMoM, depth, numpairs, (notarization ht, MoMoM offset)
if ( len+48-opoffset <= opretlen && strcmp(ccdata.symbol,SMART_CHAIN_SYMBOL) == 0 )
{
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.kmdstarti);
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.kmdendi);
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.hushstarti);
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.hushendi);
len += dragon_rwbignum(0,&scriptbuf[len],sizeof(MoMoMdata.MoMoM),(uint8_t *)&MoMoMdata.MoMoM);
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.MoMoMdepth);
len += dragon_rwnum(0,&scriptbuf[len],sizeof(uint32_t),(uint8_t *)&MoMoMdata.numpairs);

4
src/hush_bitcoind.h

@ -868,10 +868,10 @@ int32_t hush_minerids(uint8_t *minerids,int32_t height,int32_t width)
return(nonz);
}
int32_t hush_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip)
int32_t hush_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *hushstartip,int32_t *hushendip)
{
int32_t depth,notarized_ht; uint256 MoM,hushtxid;
depth = hush_MoMdata(&notarized_ht,&MoM,&hushtxid,nHeight,MoMoMp,MoMoMoffsetp,MoMoMdepthp,kmdstartip,kmdendip);
depth = hush_MoMdata(&notarized_ht,&MoM,&hushtxid,nHeight,MoMoMp,MoMoMoffsetp,MoMoMdepthp,hushstartip,hushendip);
memset(MoMp,0,sizeof(*MoMp));
memset(hushtxidp,0,sizeof(*hushtxidp));
*notarized_heightp = 0;

24
src/hush_ccdata.h

@ -41,7 +41,7 @@ uint256 hush_calcMoM(int32_t height,int32_t MoMdepth)
return BuildMerkleTree(&fMutated, leaves, tree);
}
struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t kmdstarti,int32_t kmdendi)
struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t hushstarti,int32_t hushendi)
{
struct hush_ccdata_entry *allMoMs=0; struct hush_ccdata *ccdata,*tmpptr; int32_t i,num,max;
bool fMutated; std::vector<uint256> tree, leaves;
@ -49,7 +49,7 @@ struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t kmd
portable_mutex_lock(&HUSH_CC_mutex);
DL_FOREACH_SAFE(CC_data,ccdata,tmpptr)
{
if ( ccdata->MoMdata.height <= kmdendi && ccdata->MoMdata.height >= kmdstarti )
if ( ccdata->MoMdata.height <= hushendi && ccdata->MoMdata.height >= hushstarti )
{
if ( num >= max )
{
@ -63,7 +63,7 @@ struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t kmd
strcpy(allMoMs[num].symbol,ccdata->symbol);
num++;
}
if ( ccdata->MoMdata.height < kmdstarti )
if ( ccdata->MoMdata.height < hushstarti )
break;
}
portable_mutex_unlock(&HUSH_CC_mutex);
@ -116,7 +116,7 @@ int32_t hush_MoMoMdata(char *hexstr,int32_t hexsize,struct hush_ccdataMoMoM *mda
{
if ( ccdata->MoMdata.height < hushheight )
{
//fprintf(stderr,"%s notarized.%d kmd.%d\n",ccdata->symbol,ccdata->MoMdata.notarized_height,ccdata->MoMdata.height);
//fprintf(stderr,"%s notarized.%d HUSH3.%d\n",ccdata->symbol,ccdata->MoMdata.notarized_height,ccdata->MoMdata.height);
if ( strcmp(ccdata->symbol,symbol) == 0 )
{
if ( endi == 0 )
@ -136,8 +136,8 @@ int32_t hush_MoMoMdata(char *hexstr,int32_t hexsize,struct hush_ccdataMoMoM *mda
}
}
portable_mutex_unlock(&HUSH_CC_mutex);
mdata->kmdstarti = starti;
mdata->kmdendi = endi;
mdata->hushstarti = starti;
mdata->hushendi = endi;
if ( starti != 0 && endi != 0 && endi >= starti )
{
if ( (allMoMs= hush_allMoMs(&depth,&mdata->MoMoM,starti,endi)) != 0 )
@ -151,8 +151,8 @@ int32_t hush_MoMoMdata(char *hexstr,int32_t hexsize,struct hush_ccdataMoMoM *mda
if ( mdata->numpairs > 0 )
{
len += dragon_rwnum(1,&hexdata[len],sizeof(CCid),(uint8_t *)&CCid);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->kmdstarti);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->kmdendi);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->hushstarti);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->hushendi);
len += dragon_rwbignum(1,&hexdata[len],sizeof(mdata->MoMoM),(uint8_t *)&mdata->MoMoM);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->MoMoMdepth);
len += dragon_rwnum(1,&hexdata[len],sizeof(uint32_t),(uint8_t *)&mdata->numpairs);
@ -255,12 +255,12 @@ int32_t hush_rwccdata(char *thischain,int32_t rwflag,struct hush_ccdata *ccdata,
np->MoMoM = MoMoMdata->MoMoM;
np->MoMoMdepth = MoMoMdata->MoMoMdepth;
np->MoMoMoffset = MoMoMdata->MoMoMoffset;
np->kmdstarti = MoMoMdata->kmdstarti;
np->kmdendi = MoMoMdata->kmdendi;
np->hushstarti = MoMoMdata->hushstarti;
np->hushendi = MoMoMdata->hushendi;
}
else if ( memcmp(&np->MoMoM,&MoMoMdata->MoMoM,sizeof(np->MoMoM)) != 0 || np->MoMoMdepth != MoMoMdata->MoMoMdepth || np->MoMoMoffset != MoMoMdata->MoMoMoffset || np->kmdstarti != MoMoMdata->kmdstarti || np->kmdendi != MoMoMdata->kmdendi )
else if ( memcmp(&np->MoMoM,&MoMoMdata->MoMoM,sizeof(np->MoMoM)) != 0 || np->MoMoMdepth != MoMoMdata->MoMoMdepth || np->MoMoMoffset != MoMoMdata->MoMoMoffset || np->hushstarti != MoMoMdata->hushstarti || np->hushendi != MoMoMdata->hushendi )
{
fprintf(stderr,"preexisting MoMoM mismatch: %s (%d %d %d %d) vs %s (%d %d %d %d)\n",np->MoMoM.ToString().c_str(),np->MoMoMdepth,np->MoMoMoffset,np->kmdstarti,np->kmdendi,MoMoMdata->MoMoM.ToString().c_str(),MoMoMdata->MoMoMdepth,MoMoMdata->MoMoMoffset,MoMoMdata->kmdstarti,MoMoMdata->kmdendi);
fprintf(stderr,"preexisting MoMoM mismatch: %s (%d %d %d %d) vs %s (%d %d %d %d)\n",np->MoMoM.ToString().c_str(),np->MoMoMdepth,np->MoMoMoffset,np->hushstarti,np->hushendi,MoMoMdata->MoMoM.ToString().c_str(),MoMoMdata->MoMoMdepth,MoMoMdata->MoMoMoffset,MoMoMdata->hushstarti,MoMoMdata->hushendi);
}
}
}

18
src/hush_gateway.h

@ -350,7 +350,7 @@ uint64_t hush_paxtotal()
//int32_t j; for (j=0; j<32; j++)
// printf("%02x",((uint8_t *)&pax->txid)[j]);
//if ( strcmp(str,SMART_CHAIN_SYMBOL) == 0 )
// printf(" v%d %p got WITHDRAW.%s kmd.%d ht.%d %.8f -> %.8f/%.8f\n",pax->vout,pax,pax->source,pax->height,pax->otherheight,dstr(pax->fiatoshis),dstr(pax->puposhis),dstr(checktoshis));
// printf(" v%d %p got WITHDRAW.%s HUSH3.%d ht.%d %.8f -> %.8f/%.8f\n",pax->vout,pax,pax->source,pax->height,pax->otherheight,dstr(pax->fiatoshis),dstr(pax->puposhis),dstr(checktoshis));
}
}
}
@ -453,7 +453,7 @@ int32_t hush_pending_withdraws(char *opretstr) // todo: enforce deterministic or
paxes[n++] = pax;
//int32_t j; for (j=0; j<32; j++)
// printf("%02x",((uint8_t *)&pax->txid)[j]);
//printf(" %s.(kmdht.%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));
//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));
}
}
}
@ -480,7 +480,7 @@ int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t toko
struct pax_transaction *pax,*tmp; char symbol[HUSH_SMART_CHAIN_MAXLEN],dest[HUSH_SMART_CHAIN_MAXLEN]; uint8_t *script,opcode,opret[16384*4],data[16384*4]; int32_t i,baseid,ht,len=0,opretlen=0,numvouts=1; struct hush_state *sp; uint64_t available,deposited,issued,withdrawn,approved,redeemed,mask,sum = 0;
if ( HUSH_PASSPORT_INITDONE == 0 )//HUSH_PAX == 0 ||
return(0);
struct hush_state *kmdsp = hush_stateptrget((char *)"HUSH3");
struct hush_state *hushsp = hush_stateptrget((char *)"HUSH3");
sp = hush_stateptr(symbol,dest);
strcpy(symbol,base);
if ( SMART_CHAIN_SYMBOL[0] != 0 && hush_baseid(SMART_CHAIN_SYMBOL) < 0 )
@ -516,14 +516,14 @@ int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t toko
#ifdef HUSH_SMART_CHAINS_WAITNOTARIZE
if ( pax->height > 236000 )
{
if ( kmdsp != 0 && kmdsp->NOTARIZED_HEIGHT >= pax->height )
if ( hushsp != 0 && hushsp->NOTARIZED_HEIGHT >= pax->height )
pax->validated = pax->puposhis;
else if ( kmdsp->CURRENT_HEIGHT > pax->height+30 )
else if ( hushsp->CURRENT_HEIGHT > pax->height+30 )
pax->validated = pax->ready = 0;
}
else
{
if ( kmdsp != 0 && (kmdsp->NOTARIZED_HEIGHT >= pax->height || kmdsp->CURRENT_HEIGHT > pax->height+30) ) // assumes same chain as notarize
if ( hushsp != 0 && (hushsp->NOTARIZED_HEIGHT >= pax->height || hushsp->CURRENT_HEIGHT > pax->height+30) ) // assumes same chain as notarize
pax->validated = pax->puposhis;
else pax->validated = pax->ready = 0;
}
@ -546,7 +546,7 @@ int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t toko
if ( SMART_CHAIN_SYMBOL[0] != 0 && (strcmp(pax->symbol,symbol) != 0 || pax->validated == 0 || pax->ready == 0) )
{
if ( strcmp(pax->symbol,SMART_CHAIN_SYMBOL) == 0 )
printf("pax->symbol.%s != %s or null pax->validated %.8f ready.%d ht.(%d %d)\n",pax->symbol,symbol,dstr(pax->validated),pax->ready,kmdsp->CURRENT_HEIGHT,pax->height);
printf("pax->symbol.%s != %s or null pax->validated %.8f ready.%d ht.(%d %d)\n",pax->symbol,symbol,dstr(pax->validated),pax->ready,hushsp->CURRENT_HEIGHT,pax->height);
pax->marked = pax->height;
continue;
}
@ -554,7 +554,7 @@ int32_t hush_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t toko
continue;
if ( pax->type == 'A' && SMART_CHAIN_SYMBOL[0] == 0 )
{
if ( kmdsp != 0 )
if ( hushsp != 0 )
{
if ( (baseid= hush_baseid(pax->symbol)) < 0 || ((1LL << baseid) & sp->RTmask) == 0 )
{
@ -1019,7 +1019,7 @@ const char *hush_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int32_
printf("########### %p withdrawn %s += %.8f check %.8f\n",basesp,base,dstr(value),dstr(checktoshis));
}
if ( 0 && strcmp(base,"RUB") == 0 && (pax == 0 || pax->approved == 0) )
printf("notarize %s %.8f -> %.8f kmd.%d other.%d\n",SMART_CHAIN_SYMBOL,dstr(value),dstr(puposhis),hushheight,height);
printf("notarize %s %.8f -> %.8f HUSH3.%d other.%d\n",SMART_CHAIN_SYMBOL,dstr(value),dstr(puposhis),hushheight,height);
}
hush_gateway_deposit(coinaddr,0,(char *)"HUSH3",value,rmd160,txid,vout,'W',hushheight,height,source,0);
if ( (pax= hush_paxfind(txid,vout,'W')) != 0 )

2
src/hush_globals.h

@ -21,7 +21,7 @@ void hush_prefetch(FILE *fp);
uint32_t hush_heightstamp(int32_t height);
void hush_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t kheight,uint32_t ktime,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout,uint256 MoM,int32_t MoMdepth);
void hush_init(int32_t height);
int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip);
int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *hushstartip,int32_t *hushendip);
int32_t hush_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp);
char *hush_issuemethod(char *userpass,char *method,char *params,uint16_t port);
void hush_init(int32_t height);

8
src/hush_notary.h

@ -339,7 +339,7 @@ int32_t hush_dpowconfs(int32_t txheight,int32_t numconfs)
return(numconfs);
}
int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t height,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip)
int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t height,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *hushstartip,int32_t *hushendip)
{
struct notarized_checkpoint *np = 0;
if ( (np= hush_npptr(height)) != 0 )
@ -350,11 +350,11 @@ int32_t hush_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int
*MoMoMp = np->MoMoM;
*MoMoMoffsetp = np->MoMoMoffset;
*MoMoMdepthp = np->MoMoMdepth;
*kmdstartip = np->kmdstarti;
*kmdendip = np->kmdendi;
*hushstartip = np->hushstarti;
*hushendip = np->hushendi;
return(np->MoMdepth & 0xffff);
}
*notarized_htp = *MoMoMoffsetp = *MoMoMdepthp = *kmdstartip = *kmdendip = 0;
*notarized_htp = *MoMoMoffsetp = *MoMoMdepthp = *hushstartip = *hushendip = 0;
memset(MoMp,0,sizeof(*MoMp));
memset(MoMoMp,0,sizeof(*MoMoMp));
memset(hushtxidp,0,sizeof(*hushtxidp));

4
src/hush_structs.h

@ -88,7 +88,7 @@ struct knotaries_entry { int32_t height,numnotaries; struct knotary_entry *Notar
struct notarized_checkpoint
{
uint256 notarized_hash,notarized_desttxid,MoM,MoMoM;
int32_t nHeight,notarized_height,MoMdepth,MoMoMdepth,MoMoMoffset,kmdstarti,kmdendi;
int32_t nHeight,notarized_height,MoMdepth,MoMoMdepth,MoMoMoffset,hushstarti,hushendi;
};
struct hush_ccdataMoM
@ -103,7 +103,7 @@ struct hush_ccdatapair { int32_t notarized_height,MoMoMoffset; };
struct hush_ccdataMoMoM
{
uint256 MoMoM;
int32_t kmdstarti,kmdendi,MoMoMoffset,MoMoMdepth,numpairs,len;
int32_t hushstarti,hushendi,MoMoMoffset,MoMoMdepth,numpairs,len;
struct hush_ccdatapair *pairs;
};

16
src/rpc/blockchain.cpp

@ -942,18 +942,18 @@ UniValue minerids(const UniValue& params, bool fHelp, const CPubKey& mypk)
}
for (i=0; i<64; i++)
{
UniValue item(UniValue::VOBJ); std::string hex,hushaddress; char *hexstr,kmdaddr[64],*ptr; int32_t m;
UniValue item(UniValue::VOBJ); std::string hex,hushaddress; char *hexstr,hushaddr[64],*ptr; int32_t m;
hex.resize(66);
hexstr = (char *)hex.data();
for (j=0; j<33; j++)
sprintf(&hexstr[j*2],"%02x",pubkeys[i][j]);
item.push_back(Pair("notaryid", i));
bitcoin_address(kmdaddr,60,pubkeys[i],33);
m = (int32_t)strlen(kmdaddr);
bitcoin_address(hushaddr,60,pubkeys[i],33);
m = (int32_t)strlen(hushaddr);
hushaddress.resize(m);
ptr = (char *)hushaddress.data();
memcpy(ptr,kmdaddr,m);
memcpy(ptr,hushaddr,m);
item.push_back(Pair("HUSHaddress", hushaddress));
item.push_back(Pair("pubkey", hex));
@ -973,7 +973,7 @@ UniValue minerids(const UniValue& params, bool fHelp, const CPubKey& mypk)
UniValue notaries(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
UniValue a(UniValue::VARR); uint32_t timestamp=0; UniValue ret(UniValue::VOBJ); int32_t i,j,n,m; char *hexstr; uint8_t pubkeys[64][33]; char btcaddr[64],kmdaddr[64],*ptr;
UniValue a(UniValue::VARR); uint32_t timestamp=0; UniValue ret(UniValue::VOBJ); int32_t i,j,n,m; char *hexstr; uint8_t pubkeys[64][33]; char btcaddr[64],hushaddr[64],*ptr;
if ( fHelp || (params.size() != 1 && params.size() != 2) )
throw runtime_error("notaries height timestamp\n");
LOCK(cs_main);
@ -1011,11 +1011,11 @@ UniValue notaries(const UniValue& params, bool fHelp, const CPubKey& mypk)
memcpy(ptr,btcaddr,m);
item.push_back(Pair("BTCaddress", btcaddress));
bitcoin_address(kmdaddr,60,pubkeys[i],33);
m = (int32_t)strlen(kmdaddr);
bitcoin_address(hushaddr,60,pubkeys[i],33);
m = (int32_t)strlen(hushaddr);
hushaddress.resize(m);
ptr = (char *)hushaddress.data();
memcpy(ptr,kmdaddr,m);
memcpy(ptr,hushaddr,m);
item.push_back(Pair("HUSHaddress", hushaddress));
a.push_back(item);
}

12
src/rpc/crosschain.cpp

@ -56,9 +56,9 @@ int32_t ensure_CCrequirements(uint8_t evalcode);
bool EnsureWalletIsAvailable(bool avoidException);
int32_t hush_MoM(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip);
int32_t hush_MoM(int32_t *notarized_htp,uint256 *MoMp,uint256 *hushtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *hushstartip,int32_t *hushendip);
int32_t hush_MoMoMdata(char *hexstr,int32_t hexsize,struct hush_ccdataMoMoM *mdata,char *symbol,int32_t hushheight,int32_t notarized_height);
struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t kmdstarti,int32_t kmdendi);
struct hush_ccdata_entry *hush_allMoMs(int32_t *nump,uint256 *MoMoMp,int32_t hushstarti,int32_t hushendi);
uint256 hush_calcMoM(int32_t height,int32_t MoMdepth);
int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp);
extern std::string ASSETCHAINS_SELFIMPORT;
@ -93,7 +93,7 @@ UniValue crosschainproof(const UniValue& params, bool fHelp, const CPubKey& mypk
UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
int32_t height,depth,notarized_height,MoMoMdepth,MoMoMoffset,kmdstarti,kmdendi; uint256 MoM,MoMoM,hushtxid; uint32_t timestamp = 0; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR);
int32_t height,depth,notarized_height,MoMoMdepth,MoMoMoffset,hushstarti,hushendi; uint256 MoM,MoMoM,hushtxid; uint32_t timestamp = 0; UniValue ret(UniValue::VOBJ); UniValue a(UniValue::VARR);
if ( fHelp || params.size() != 1 )
throw runtime_error("height_MoM height\n");
LOCK(cs_main);
@ -108,7 +108,7 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk)
height = chainActive.Tip()->GetHeight();
}
//fprintf(stderr,"height_MoM height.%d\n",height);
depth = hush_MoM(&notarized_height,&MoM,&hushtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&kmdstarti,&kmdendi);
depth = hush_MoM(&notarized_height,&MoM,&hushtxid,height,&MoMoM,&MoMoMoffset,&MoMoMdepth,&hushstarti,&hushendi);
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH" : SMART_CHAIN_SYMBOL)));
ret.push_back(Pair("height",height));
ret.push_back(Pair("timestamp",(uint64_t)timestamp));
@ -123,8 +123,8 @@ UniValue height_MoM(const UniValue& params, bool fHelp, const CPubKey& mypk)
ret.push_back(Pair("MoMoM",MoMoM.GetHex()));
ret.push_back(Pair("MoMoMoffset",MoMoMoffset));
ret.push_back(Pair("MoMoMdepth",MoMoMdepth));
ret.push_back(Pair("kmdstarti",kmdstarti));
ret.push_back(Pair("kmdendi",kmdendi));
ret.push_back(Pair("hushstarti",hushstarti));
ret.push_back(Pair("hushendi",hushendi));
}
} else ret.push_back(Pair("error",(char *)"no MoM for height"));

5
src/stratum.cpp

@ -2080,8 +2080,7 @@ UniValue rpc_stratum_setdifficulty (const UniValue& params, bool fHelp, const CP
} else {
if (ParseDouble(param_str, &hush_diff)) {
// kmd diff as a str passed
// hush diff as a str passed
// difficulty = difficulty_1_target / current_target
arith_uint256 target;
ccminer::hush_diff_to_target_equi((uint32_t *)&target, hush_diff);
@ -2091,7 +2090,7 @@ UniValue rpc_stratum_setdifficulty (const UniValue& params, bool fHelp, const CP
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid difficulty (not hex target, not hush_diff)");
}
} else if (params[0].getType() == UniValue::VNUM) {
// kmd diff as a num passed
// hush diff as a num passed
hush_diff = params[0].get_real();
// difficulty = difficulty_1_target / current_target

2
src/zcash/JoinSplit.cpp

@ -4,10 +4,8 @@
#include "JoinSplit.hpp"
#include "prf.h"
#include "sodium.h"
#include <memory>
#include <fstream>
#include "librustzcash.h"
namespace libzcash {

Loading…
Cancel
Save