From 252031d2a33e234ae2b315fbcdefc56c044d75cd Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 13 Apr 2018 19:05:59 +0300 Subject: [PATCH] Test --- src/komodo_notary.h | 15 +++++++++++++++ src/komodo_structs.h | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/komodo_notary.h b/src/komodo_notary.h index 393e89796..5f534957f 100644 --- a/src/komodo_notary.h +++ b/src/komodo_notary.h @@ -399,6 +399,21 @@ int32_t komodo_notarized_height(uint256 *hashp,uint256 *txidp) } +struct notarized_checkpoint *komodo_npptr(int32_t height) +{ + char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; int32_t i; struct komodo_state *sp; struct notarized_checkpoint *np = 0; + if ( (sp= komodo_stateptr(symbol,dest)) != 0 ) + { + for (i=sp->NUM_NPOINTS-1; i>=0; i--) + { + np = &sp->NPOINTS[i]; + if ( np->MoMdepth > 0 && height > np->notarized_height-np->MoMdepth && height <= np->notarized_height ) + return(np); + } + } + return(0); +} + int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int32_t height,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip) { struct notarized_checkpoint *np = 0; diff --git a/src/komodo_structs.h b/src/komodo_structs.h index 38a2b3138..50984eb31 100644 --- a/src/komodo_structs.h +++ b/src/komodo_structs.h @@ -85,8 +85,8 @@ struct knotary_entry { UT_hash_handle hh; uint8_t pubkey[33],notaryid; }; struct knotaries_entry { int32_t height,numnotaries; struct knotary_entry *Notaries; }; struct notarized_checkpoint { - uint256 notarized_hash,notarized_desttxid,MoM; - int32_t nHeight,notarized_height,MoMdepth; + uint256 notarized_hash,notarized_desttxid,MoM,MoMoM; + int32_t nHeight,notarized_height,MoMdepth,MoMoMdepth,MoMoMoffset,kmdstarti,kmdendi; }; struct komodo_state