]>
Commit | Line | Data |
---|---|---|
98f2e433 | 1 | /****************************************************************************** |
37fed603 | 2 | * Copyright © 2014-2017 The SuperNET Developers. * |
98f2e433 | 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 | ||
5416af1d | 16 | #include "komodo_defs.h" |
17 | ||
709a9861 | 18 | uint32_t komodo_heightstamp(int32_t height); |
c88fa588 | 19 | void komodo_stateupdate(int32_t height,uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t notaryid,uint256 txhash,uint64_t voutmask,uint8_t numvouts,uint32_t *pvals,uint8_t numpvals,int32_t kheight,uint32_t ktime,uint64_t opretvalue,uint8_t *opretbuf,uint16_t opretlen,uint16_t vout,uint256 MoM,int32_t MoMdepth); |
cf0ace4a | 20 | void komodo_init(int32_t height); |
b3548b52 | 21 | int32_t komodo_MoMdata(int32_t *notarized_htp,uint256 *MoMp,uint256 *kmdtxidp,int32_t nHeight); |
cf0ace4a | 22 | int32_t komodo_notarizeddata(int32_t nHeight,uint256 *notarized_hashp,uint256 *notarized_desttxidp); |
0ded57c8 | 23 | char *komodo_issuemethod(char *userpass,char *method,char *params,uint16_t port); |
cf0ace4a | 24 | void komodo_init(int32_t height); |
25 | void komodo_assetchain_pubkeys(char *jsonstr); | |
8683bd8d | 26 | int32_t komodo_chosennotary(int32_t *notaryidp,int32_t height,uint8_t *pubkey33,uint32_t timestamp); |
48a3cd18 | 27 | int32_t komodo_isrealtime(int32_t *kmdheightp); |
b4116bb6 | 28 | uint64_t komodo_paxtotal(); |
439e76ae | 29 | int32_t komodo_longestchain(); |
afacf361 | 30 | uint64_t komodo_maxallowed(int32_t baseid); |
c2123afe | 31 | int32_t komodo_bannedset(int32_t *indallvoutsp,uint256 *array,int32_t max); |
cf0ace4a | 32 | |
3face669 | 33 | pthread_mutex_t komodo_mutex; |
0db8cd28 | 34 | |
335f2ea7 | 35 | #define KOMODO_ELECTION_GAP 2000 //((ASSETCHAINS_SYMBOL[0] == 0) ? 2000 : 100) |
15d0fbd4 | 36 | #define IGUANA_MAXSCRIPTSIZE 10001 |
7c130297 | 37 | #define KOMODO_ASSETCHAIN_MAXLEN 65 |
0db8cd28 | 38 | |
0db8cd28 | 39 | struct pax_transaction *PAX; |
40 | int32_t NUM_PRICES; uint32_t *PVALS; | |
41 | struct knotaries_entry *Pubkeys; | |
0db8cd28 | 42 | |
2d116f01 | 43 | struct komodo_state KOMODO_STATES[34]; |
0db8cd28 | 44 | |
7e2cbee1 | 45 | #define _COINBASE_MATURITY 100 |
7a90b9dd | 46 | int COINBASE_MATURITY = _COINBASE_MATURITY;//100; |
1290fc05 | 47 | |
acad2983 | 48 | int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND; |
052f0068 | 49 | int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE,ASSETCHAINS_CC; |
8683bd8d | 50 | std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY; |
51 | uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33]; | |
98f2e433 | 52 | |
7c130297 | 53 | char ASSETCHAINS_SYMBOL[KOMODO_ASSETCHAIN_MAXLEN]; |
98f2e433 | 54 | uint16_t ASSETCHAINS_PORT; |
55 | uint32_t ASSETCHAIN_INIT; | |
56 | uint32_t ASSETCHAINS_MAGIC = 2387029918; | |
36647d52 MT |
57 | uint64_t ASSETCHAINS_SUPPLY = 10; |
58 | uint64_t ASSETCHAINS_COMMISSION; | |
a0dd01bc | 59 | int64_t ASSETCHAINS_GENESISTXVAL = 5000000000; |
36647d52 | 60 | |
29bd53a1 MT |
61 | // consensus variables for coinbase timelock control and timelock transaction support |
62 | // time locks are specified enough to enable their use initially to lock specific coinbase transactions for emission control | |
63 | // to be verifiable, timelocks require additional data that enables them to be validated and their ownership and | |
64 | // release time determined from the blockchain. to do this, every time locked output according to this | |
65 | // spec will use an op_return with CLTV at front and anything after |OP_RETURN|PUSH of rest|OPRETTYPE_TIMELOCK|script| | |
6b78e01d | 66 | #define _ASSETCHAINS_TIMELOCKOFF -1 |
7daf6567 | 67 | int64_t ASSETCHAINS_TIMELOCKGTE = _ASSETCHAINS_TIMELOCKOFF; |
42181656 | 68 | uint64_t ASSETCHAINS_TIMEUNLOCKFROM = 0, ASSETCHAINS_TIMEUNLOCKTO = 0; |
d121e75b | 69 | |
6b78e01d | 70 | uint32_t ASSETCHAINS_LASTERA = 1; |
26a8d194 | 71 | uint64_t ASSETCHAINS_ENDSUBSIDY[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_REWARD[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_HALVING[ASSETCHAINS_MAX_ERAS],ASSETCHAINS_DECAY[ASSETCHAINS_MAX_ERAS]; |
98f2e433 | 72 | |
42181656 | 73 | #define _ASSETCHAINS_EQUIHASH 0 |
74 | uint32_t ASSETCHAINS_NUMALGOS = 2; | |
75 | uint32_t ASSETCHAINS_EQUIHASH = _ASSETCHAINS_EQUIHASH; | |
76 | uint32_t ASSETCHAINS_VERUSHASH = 1; | |
77 | const char *ASSETCHAINS_ALGORITHMS[] = {"equihash", "verushash"}; | |
78 | uint64_t ASSETCHAINS_NONCEMASK[] = {0xffff,0xffffff}; | |
79 | uint32_t ASSETCHAINS_NONCESHIFT[] = {32,40}; | |
2910478b | 80 | uint32_t ASSETCHAINS_HASHESPERROUND[] = {1,512}; |
42181656 | 81 | uint32_t ASSETCHAINS_ALGO = _ASSETCHAINS_EQUIHASH; |
82 | ||
ab918767 | 83 | uint32_t KOMODO_INITDONE; |
05e307ec | 84 | char KMDUSERPASS[4096],BTCUSERPASS[4096]; uint16_t KMD_PORT = 7771,BITCOIND_PORT = 7771; |
f846a857 | 85 | uint64_t PENDING_KOMODO_TX; |
15d0fbd4 | 86 | |
87 | struct komodo_kv *KOMODO_KV; | |
8ee93080 | 88 | pthread_mutex_t KOMODO_KV_mutex; |