forked from litecoin-foundation/loafwallet-core
-
Notifications
You must be signed in to change notification settings - Fork 2
/
BRGhostnode.h
77 lines (61 loc) · 1.6 KB
/
BRGhostnode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// BRGhostnode.h
// nixwallet
//
// Created by Matthew T on 1/12/19.
// Copyright © 2019 Nix Platform. All rights reserved.
//
#ifndef BRGhostnode_h
#define BRGhostnode_h
#include <stdio.h>
#include "BRKey.h"
#include "BRInt.h"
#include "BRTransaction.h"
#include "BRPeer.h"
#include <stddef.h>
#include <inttypes.h>
#ifdef __cplusplus
extern "C" {
#endif
enum state {
GHOSTNODE_PRE_ENABLED,
GHOSTNODE_ENABLED,
GHOSTNODE_EXPIRED,
GHOSTNODE_OUTPOINT_SPENT,
GHOSTNODE_UPDATE_REQUIRED,
GHOSTNODE_WATCHDOG_EXPIRED,
GHOSTNODE_NEW_START_REQUIRED,
GHOSTNODE_POSE_BAN
};
typedef struct dynamic_array_struct
{
unsigned char* data;
size_t capacity; /* total capacity */
size_t size; /* number of elements in vector */
} vector;
typedef struct {
char *alias;
vector vchSig;
UInt256 txHash;
BRTxInput *vin;
uint32_t lockTime;
uint32_t blockHeight;
uint32_t timestamp; // time interval since unix epoch
BRPeer addr;
BRKey pubKeyCollateralAddress;
int64_t sigTime; //mnb message time
int64_t nLastDsq; //the dsq count from the last dsq broadcast of this node
int64_t nTimeLastChecked;
int64_t nTimeLastPaid;
int64_t nTimeLastWatchdogVote;
int nActiveState;
int nCacheCollateralBlock;
int nBlockLastPaid;
int nProtocolVersion;
} BRGhostnode;
BRGhostnode GhostnodeCreate(BRGhostnode ghostnode);
//int GhostnodeInit(const char *alias, const char *ip, const char *privKey, const char *txHash, const char *outputIndex);
#ifdef __cplusplus
}
#endif
#endif /* BRGhostnode_h */