else
{
if ( pindex->nHeight != hwmheight )
+ {
printf("%s hwmheight.%d vs pindex->nHeight.%d t.%u reorg.%d\n",ASSETCHAINS_SYMBOL,hwmheight,pindex->nHeight,(uint32_t)pindex->nTime,hwmheight-pindex->nHeight);
+ komodo_purge_ccdata((int32_t)pindex->nHeight);
+ hwmheight = pindex->nHeight;
+ }
komodo_event_rewind(sp,symbol,pindex->nHeight);
- komodo_stateupdate(pindex->nHeight,0,0,0,zero,0,0,0,0,-pindex->nHeight,pindex->nTime,0,0,0,0,zero,0);
+ komodo_stateupdate(pindex->nHeight,0,0,0,zero,0,0,0,0,-pindex->nHeight,pindex->nTime,0,0,0,0);//,zero,0);
}
komodo_currentheight_set(chainActive.Tip()->nHeight);
if ( pindex != 0 )
}
if ( blocktime != 0 && blocktimes[1] != 0 && blocktime < blocktimes[1]+57 )
{
- //if ( height > 790000 )
- // fprintf(stderr,"lag.%d ht.%d n.%d blocktimes[%u vs %u %u]\n",blocktime-blocktimes[1],height,notaryid,blocktime,blocktimes[0],blocktimes[1]);
- //fprintf(stderr,"lag.%d ht.%d n.%d blocktimes[%u vs %u %u]\n",blocktime-blocktimes[1],height,notaryid,blocktime,blocktimes[0],blocktimes[1]);
if ( height > 807000 )
return(-2);
}
#include "komodo_defs.h"
+void komodo_prefetch(FILE *fp);
uint32_t komodo_heightstamp(int32_t height);
- void komodo_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 komodo_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);
void komodo_init(int32_t height);
int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip);
int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp);
memset(MoMoMp,0,sizeof(*MoMoMp));
memset(kmdtxidp,0,sizeof(*kmdtxidp));
return(0);
-}*/
+}
-
int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp)
{
struct notarized_checkpoint *np = 0; int32_t i=0,flag = 0; char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp;
//for (i=0; i<sizeof(Minerids); i++)
// Minerids[i] = -2;
didinit = 1;
- komodo_stateupdate(0,0,0,0,zero,0,0,0,0,0,0,0,0,0,0,zero,0);
+ komodo_stateupdate(0,0,0,0,zero,0,0,0,0,0,0,0,0,0,0);
}
- }
-
-/*void komodo_assetchain_pubkeys(char *jsonstr)
-{
- cJSON *array; int32_t i,n; uint8_t pubkeys[64][33]; char *hexstr;
- memset(pubkeys,0,sizeof(pubkeys));
- if ( (array= cJSON_Parse(jsonstr)) != 0 )
- {
- if ( (n= cJSON_GetArraySize(array)) > 0 )
- {
- for (i=0; i<n; i++)
- {
- if ( (hexstr= jstri(array,i)) != 0 && is_hexstr(hexstr,0) == 66 )
- {
- decode_hex(pubkeys[i],33,hexstr);
- fprintf(stderr,"i.%d of n.%d pubkey.(%s)\n",i,n,hexstr);
- }
- else
- {
- fprintf(stderr,"illegal hexstr.(%s) i.%d of n.%d\n",hexstr,i,n);
- break;
- }
- }
- if ( i == n )
- {
- komodo_init(-1);
- komodo_notarysinit(0,pubkeys,n);
- KOMODO_EXTERNAL_NOTARIES = 1;
- //printf("initialize pubkeys[%d]\n",n);
- } else fprintf(stderr,"komodo_assetchain_pubkeys i.%d vs n.%d\n",i,n);
- } else fprintf(stderr,"assetchain pubkeys n.%d\n",n);
- }
- //else if ( jsonstr != 0 )
- // fprintf(stderr,"assetchain pubkeys couldnt parse.(%s)\n",jsonstr);
-}*/
+}
{ "paxprices", 3 },
{ "paxpending", 0 },
{ "notaries", 2 },
- //{ "height_MoM", 1 },
- //{ "txMoMproof", 1 },
+ { "height_MoM", 1 },
- //{ "MoMoMdata", 3 },
++ { "MoMoMdata", 3 },
+ { "allMoMs", 2 },
+ { "txMoMproof", 1 },
{ "minerids", 1 },
{ "kvsearch", 1 },
{ "kvupdate", 4 },