Browse Source

Change to STAKED + STKD and try out surpress every 5 KMD blocks

blackjok3r
blackjok3r 6 years ago
parent
commit
ba8ef264cc
  1. 5
      iguana/dpow/dpow_rpc.c
  2. 12
      iguana/iguana_notary.c

5
iguana/dpow/dpow_rpc.c

@ -288,7 +288,8 @@ int32_t dpow_paxpending(struct supernet_info *myinfo,uint8_t *hex,int32_t hexsiz
n += iguana_rwbignum(1,&hex[n],sizeof(MoM),MoM.bytes);
MoMdepth = (MoMdepth & 0xffff) | ((uint32_t)CCid<<16);
n += iguana_rwnum(1,&hex[n],sizeof(MoMdepth),(uint32_t *)&MoMdepth);
if ( strncmp(bp->srccoin->symbol,"STKD",4) == 0 && src_or_dest == 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 )
if ( ( (strlen(symbol) >= 4 && strncmp(symbol, "STKD", 4) == 0) || (strlen(symbol) >= 6 && strncmp(symbol, "STAKED", 6) == 0) ) && src_or_dest == 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 )
{
kmdcoin = bp->destcoin;
if ( (infojson= dpow_getinfo(myinfo,kmdcoin)) != 0 )
@ -301,7 +302,7 @@ int32_t dpow_paxpending(struct supernet_info *myinfo,uint8_t *hex,int32_t hexsiz
if ( (hexstr= jstr(retjson,"data")) != 0 && (hexlen= (int32_t)strlen(hexstr)) > 0 && n+hexlen/2 <= hexsize )
{
hexlen >>= 1;
//printf("add MoMoMdata.(%s)\n",hexstr);
printf("add MoMoMdata.(%s)\n",hexstr);
decode_hex(&hex[n],hexlen,hexstr), n += hexlen;
}
free_json(retjson);

12
iguana/iguana_notary.c

@ -61,16 +61,20 @@ void dpow_checkpointset(struct supernet_info *myinfo,struct dpow_checkpoint *che
void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime)
{
//struct komodo_ccdataMoMoM mdata; cJSON *blockjson; uint64_t signedmask; struct iguana_info *coin;
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t i,ht,suppress=0; struct dpow_block *bp;
void **ptrs; char str[65]; struct dpow_checkpoint checkpoint; int32_t checkpointfreq,i,ht,suppress=0; struct dpow_block *bp;
dpow_checkpointset(myinfo,&dp->last,height,hash,timestamp,blocktime);
checkpoint = dp->srcfifo[dp->srcconfirms];
dpow_fifoupdate(myinfo,dp->srcfifo,dp->last);
if ( strcmp(dp->dest,"KMD") == 0 )
{
if ( dp->DESTHEIGHT < dp->prevDESTHEIGHT+DPOW_CHECKPOINTFREQ )
checkpointfreq = DPOW_CHECKPOINTFREQ
if ( (strlen(dp->symbol) >= 4 && strncmp(dp->symbol, "STKD", 4) == 0) || (strlen(dp->symbol) >= 6 && strncmp(dp->symbol, "STAKED", 6) == 0) )
checkpointfreq = 5;
if ( dp->DESTHEIGHT < dp->prevDESTHEIGHT+checkpointfreq )
{
suppress = strncmp("STKD",dp->symbol,4) != 0;
//fprintf(stderr,"suppress %s -> KMD\n",dp->symbol);
suppress = 1;
// suppress = strncmp("STKD",dp->symbol,4) != 0;
fprintf(stderr,"suppress %s -> KMD freq KMD blocks.%d\n",dp->symbol,checkpointfreq);
}
}
/*if ( strcmp(dp->dest,"KMD") == 0 )//|| strcmp(dp->dest,"CHAIN") == 0 )

Loading…
Cancel
Save