-
Notifications
You must be signed in to change notification settings - Fork 9
/
coind.h
113 lines (80 loc) · 2.01 KB
/
coind.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
struct YAAMP_COIND_AUX
{
YAAMP_COIND *coind;
// int height;
int index;
int chainid;
char hash[1024];
char target[1024];
};
class YAAMP_COIND: public YAAMP_OBJECT
{
public:
bool touch;
bool newcoind;
YAAMP_RPC rpc;
char rpcencoding[32];
// pthread_t thread;
pthread_mutex_t mutex;
// pthread_cond_t cond;
// bool closing;
char name[1024];
char symbol[256];
char symbol2[256];
char algo[256];
char wallet[1024];
char account[256];
char pubkey[1024];
char script_pubkey[1024];
bool p2sh_address;
bool pos;
bool hassubmitblock;
bool txmessage;
char charity_address[1024];
double charity_amount;
double charity_percent;
bool enable;
bool auto_ready;
bool newblock;
char lastnotifyhash[192];
int height;
double difficulty;
double reward;
double reward_mul;
double price;
int pool_ttf;
int actual_ttf;
bool isaux;
YAAMP_COIND_AUX aux;
int notreportingcounter;
bool usegetwork;
bool usememorypool;
bool hasmasternodes;
bool oldmasternodes;
bool multialgos; // pow_hash field (or mined_hash)
bool usesegwit;
char commitment[128];
char witness_magic[16];
YAAMP_JOB *job;
// YAAMP_JOB_TEMPLATE *templ;
};
//////////////////////////////////////////////////////////////////////////
inline void coind_delete(YAAMP_OBJECT *object)
{
YAAMP_COIND *coind = (YAAMP_COIND *)object;
object_delete(coind->job);
// if(coind->templ) delete coind->templ;
delete coind;
}
void coind_error(YAAMP_COIND *coind, const char *s);
double coind_profitability(YAAMP_COIND *coind);
double coind_nethash(YAAMP_COIND *coind);
bool coind_can_mine(YAAMP_COIND *coind, bool isaux=false);
void coind_sort();
bool coind_submit(YAAMP_COIND *coind, const char *block);
bool coind_submitgetauxblock(YAAMP_COIND *coind, const char *hash, const char *block);
void coind_init(YAAMP_COIND *coind);
void coind_terminate(YAAMP_COIND *coind);
//void coind_getauxblock(YAAMP_COIND *coind);
bool coind_create_job(YAAMP_COIND *coind, bool force=false);
bool coind_validate_user_address(YAAMP_COIND *coind, char* const address);