1 /******************************************************************************
2 * Copyright © 2014-2016 The SuperNET Developers. *
4 * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
5 * the top-level directory of this distribution for the individual copyright *
6 * holder information and the developer policies on copyright and licensing. *
8 * Unless otherwise agreed in a custom licensing agreement, no part of the *
9 * SuperNET software, including this file may be copied, modified, propagated *
10 * or distributed except according to the terms contained in the LICENSE file *
12 * Removal or modification of this copyright notice is prohibited. *
14 ******************************************************************************/
22 #define PACKED __attribute__((packed))
25 #define GENESIS_NBITS 0x1f00ffff
26 #define KOMODO_MINRATIFY ((height < 90000) ? 7 : 11)
27 #define KOMODO_MAXBLOCKS 5000000
29 #define KOMODO_EVENT_RATIFY 'P'
30 #define KOMODO_EVENT_NOTARIZED 'N'
31 #define KOMODO_EVENT_KMDHEIGHT 'K'
32 #define KOMODO_EVENT_REWIND 'B'
33 #define KOMODO_EVENT_PRICEFEED 'V'
34 #define KOMODO_EVENT_OPRETURN 'R'
35 #define KOMODO_OPRETURN_DEPOSIT 'D'
36 #define KOMODO_OPRETURN_ISSUED 'I' // assetchain
37 #define KOMODO_OPRETURN_WITHDRAW 'W' // assetchain
38 #define KOMODO_OPRETURN_REDEEMED 'X'
40 struct komodo_event_notarized { uint256 blockhash,desttxid; int32_t notarizedheight; char dest[16]; };
41 struct komodo_event_pubkeys { uint8_t num; uint8_t pubkeys[64][33]; };
42 struct komodo_event_opreturn { uint256 txid; uint64_t value; uint16_t vout,oplen; uint8_t opret[]; };
43 struct komodo_event_pricefeed { uint8_t num; uint32_t prices[35]; };
47 struct komodo_event *related;
55 struct pax_transaction
59 uint64_t komodoshis,fiatoshis,validated;
60 int32_t marked,height,otherheight,approved,didstats,ready;
62 char symbol[16],source[16],coinaddr[64]; uint8_t rmd160[20],type,buf[35];
65 struct knotary_entry { UT_hash_handle hh; uint8_t pubkey[33],notaryid; };
66 struct knotaries_entry { int32_t height,numnotaries; struct knotary_entry *Notaries; };
67 struct notarized_checkpoint { uint256 notarized_hash,notarized_desttxid; int32_t nHeight,notarized_height; };
71 uint256 NOTARIZED_HASH,NOTARIZED_DESTTXID;
72 int32_t SAVEDHEIGHT,CURRENT_HEIGHT,NOTARIZED_HEIGHT;
73 uint32_t SAVEDTIMESTAMP;
74 uint64_t deposited,issued,withdrawn,approved,redeemed,shorted;
75 struct notarized_checkpoint *NPOINTS; int32_t NUM_NPOINTS;
76 struct komodo_event **Komodo_events; int32_t Komodo_numevents;
77 uint32_t RTbufs[64][3]; uint64_t RTmask;