Browse Source

add timestamp to getinfo notarizations

pull/37/head
blackjok3r 5 years ago
parent
commit
914349db60
  1. 1
      src/komodo_nSPV.h
  2. 1
      src/komodo_nSPV_defs.h
  3. 5
      src/komodo_nSPV_fullnode.h

1
src/komodo_nSPV.h

@ -255,6 +255,7 @@ int32_t NSPV_rwntz(int32_t rwflag,uint8_t *serialized,struct NSPV_ntz *ptr)
len += iguana_rwbignum(rwflag,&serialized[len],sizeof(ptr->othertxid),(uint8_t *)&ptr->othertxid);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->height),&ptr->height);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->txidheight),&ptr->txidheight);
len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->timestamp),&ptr->timestamp);
return(len);
}

1
src/komodo_nSPV_defs.h

@ -110,6 +110,7 @@ struct NSPV_ntz
{
uint256 blockhash,txid,othertxid;
int32_t height,txidheight;
uint32_t timestamp;
};
struct NSPV_ntzsresp

5
src/komodo_nSPV_fullnode.h

@ -121,7 +121,7 @@ int32_t NSPV_setequihdr(struct NSPV_equihdr *hdr,int32_t height)
int32_t NSPV_getinfo(struct NSPV_inforesp *ptr,int32_t reqheight)
{
int32_t prevMoMheight,len = 0; CBlockIndex *pindex; struct NSPV_ntzsresp pair;
int32_t prevMoMheight,len = 0; CBlockIndex *pindex, *pindex2; struct NSPV_ntzsresp pair;
if ( (pindex= chainActive.LastTip()) != 0 )
{
ptr->height = pindex->GetHeight();
@ -130,6 +130,9 @@ int32_t NSPV_getinfo(struct NSPV_inforesp *ptr,int32_t reqheight)
if ( NSPV_getntzsresp(&pair,ptr->height-1) < 0 )
return(-1);
ptr->notarization = pair.prevntz;
if ( (pindex2= komodo_chainactive(ptr->notarization.txidheight)) != 0 )
ptr->notarization.timestamp = pindex->nTime;
fprintf(stderr, "timestamp.%i\n", ptr->notarization.timestamp );
if ( reqheight == 0 )
reqheight = ptr->height;
ptr->hdrheight = reqheight;

Loading…
Cancel
Save