]>
Commit | Line | Data |
---|---|---|
3face669 | 1 | /****************************************************************************** |
2 | * Copyright © 2014-2016 The SuperNET Developers. * | |
3 | * * | |
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. * | |
7 | * * | |
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 * | |
11 | * * | |
12 | * Removal or modification of this copyright notice is prohibited. * | |
13 | * * | |
14 | ******************************************************************************/ | |
15 | ||
5fb74817 | 16 | #include "uthash.h" |
17 | #include "utlist.h" | |
18 | ||
ab918767 | 19 | #ifdef WIN32 |
20 | #define PACKED | |
21 | #else | |
22 | #define PACKED __attribute__((packed)) | |
23 | #endif | |
24 | ||
45a3a2ff | 25 | #define GENESIS_NBITS 0x1f00ffff |
26 | #define KOMODO_MINRATIFY 7 | |
27 | #define KOMODO_MAXBLOCKS 5000000 | |
28 | ||
ab918767 | 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' | |
39 | ||
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]; }; | |
44 | ||
45 | struct komodo_event | |
46 | { | |
47 | struct komodo_event *related; | |
48 | uint16_t len; | |
49 | int32_t height; | |
50 | uint8_t type,reorged; | |
51 | char symbol[16]; | |
52 | uint8_t space[]; | |
53 | } PACKED; | |
54 | ||
3face669 | 55 | struct pax_transaction |
56 | { | |
57 | UT_hash_handle hh; | |
58 | uint256 txid; | |
59 | uint64_t komodoshis,fiatoshis; | |
a4c67285 | 60 | int32_t marked,height,otherheight,approved; |
3face669 | 61 | uint16_t vout; |
62 | char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag; | |
63 | }; | |
64 | ||
6f3cb4d0 | 65 | //struct nutxo_entry { UT_hash_handle hh; uint256 txhash; uint64_t voutmask; int32_t notaryid,height; }; |
3face669 | 66 | struct knotary_entry { UT_hash_handle hh; uint8_t pubkey[33],notaryid; }; |
67 | struct knotaries_entry { int32_t height,numnotaries; struct knotary_entry *Notaries; }; | |
68 | struct notarized_checkpoint { uint256 notarized_hash,notarized_desttxid; int32_t nHeight,notarized_height; }; | |
d1289e41 | 69 | |
70 | struct komodo_state | |
71 | { | |
72 | uint256 NOTARIZED_HASH,NOTARIZED_DESTTXID; | |
e7a90cf9 | 73 | int32_t SAVEDHEIGHT,CURRENT_HEIGHT,NOTARIZED_HEIGHT; |
f1db88ea | 74 | uint32_t SAVEDTIMESTAMP; |
03ef7187 | 75 | struct notarized_checkpoint *NPOINTS; int32_t NUM_NPOINTS; |
ab918767 | 76 | struct komodo_event **Komodo_events; int32_t Komodo_numevents; |
635dd34d | 77 | uint32_t RTbufs[64][3]; uint64_t RTmask; |
d1289e41 | 78 | }; |