Browse Source

Start adding DPoW confs

pull/152/head
Jonathan "Duke" Leto 6 years ago
parent
commit
ad411f2075
  1. 13
      src/komodo_defs.h
  2. 16
      src/komodo_rpcblockchain.h
  3. 1765
      src/komodo_utils.h

13
src/komodo_defs.h

@ -0,0 +1,13 @@
#ifndef KOMODO_DEFS_H
#define KOMODO_DEFS_H
#define ASSETCHAINS_MINHEIGHT 128
#define KOMODO_ELECTION_GAP 2000
#define ROUNDROBIN_DELAY 61
#define KOMODO_ASSETCHAIN_MAXLEN 65
#define KOMODO_LIMITED_NETWORKSIZE 4
#define IGUANA_MAXSCRIPTSIZE 10001
#define KOMODO_MAXMEMPOOLTIME 3600 // affects consensus
#define CRYPTO777_PUBSECPSTR "020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9"
#endif

16
src/komodo_rpcblockchain.h

@ -17,11 +17,27 @@
#define komodo_rpcblockchain_h
#include "main.h"
#include "komodo_utils.h"
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);
uint256 komodo_calcMoM(int32_t height,int32_t MoMdepth);
extern char ASSETCHAINS_SYMBOL[65];
int32_t komodo_dpowconfs(int32_t txheight,int32_t numconfs)
{
char symbol[KOMODO_ASSETCHAIN_MAXLEN],dest[KOMODO_ASSETCHAIN_MAXLEN]; struct komodo_state *sp;
if ( KOMODO_DPOWCONFS != 0 && txheight > 0 && numconfs > 0 && (sp= komodo_stateptr(symbol,dest)) != 0 )
{
if ( sp->NOTARIZED_HEIGHT > 0 )
{
if ( txheight < sp->NOTARIZED_HEIGHT )
return(numconfs);
else return(1);
}
}
return(numconfs);
}
int32_t komodo_MoM(int32_t *notarized_heightp,uint256 *MoMp,uint256 *kmdtxidp,int32_t nHeight,uint256 *MoMoMp,int32_t *MoMoMoffsetp,int32_t *MoMoMdepthp,int32_t *kmdstartip,int32_t *kmdendip)
{
int32_t depth,notarized_ht; uint256 MoM,kmdtxid;

1765
src/komodo_utils.h

File diff suppressed because it is too large
Loading…
Cancel
Save