mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
commit c59abe5d203fabdabcca81ff5f9c6ff133cfae3b Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Tue Nov 28 11:13:52 2017 +0100 segwit: show a segwit icon on blocks history + remove some inline styles... commit b4a8639370e6837ebc5a2047e7c334e9f931abfc Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Tue Nov 28 09:55:40 2017 +0100 segwit: cleanup + masternode case tested ok with BSD (block 400996), and with real BTX segwit txs (block 90958) also ok on VTC and GRS commit 926dbd11757ebff7f7d4930266de9b9061c8ab16 Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Sat Nov 25 18:41:01 2017 +0100 sql: add segwit fields, and ui config and fill block segwit field if it contains segwit txs, an icon is added in the dashboard "last blocks" for these blocks commit 0b13bf55e9dd1d2229d188f0f8382b27642b20da Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Sat Nov 25 13:47:20 2017 +0100 segwit: include commitment in coinbase + .conf toggle tested ok on BTX, GRS and VTC with normal txs, but the commitment merkle hash maybe need some more love... so, to prevent useless bigger blocks, only generate segwit commitment if a segwit tx is present in mempool to check with real segwit txs... not seen any yet.. commit b508bc87943d9e426cda994c2f53c16c11e8d4c3 Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Thu Mar 2 11:18:34 2017 +0100 segwit: prepare the witness data, but disabled need more test, may affect the coinbase merkle and the miners... commit 19bd3a83b9ddddd8b5ed4b7a1bdf8cf8c233e346 Author: Tanguy Pruvot <tanguy.pruvot@gmail.com> Date: Thu Mar 2 10:30:29 2017 +0100 stratum: handle and auto toggle segwit if supported
110 lines
2.3 KiB
C++
110 lines
2.3 KiB
C++
|
|
class YAAMP_WORKER: public YAAMP_OBJECT
|
|
{
|
|
public:
|
|
int userid;
|
|
int workerid;
|
|
int coinid;
|
|
int remoteid;
|
|
|
|
bool valid;
|
|
bool extranonce1;
|
|
int32_t error_number;
|
|
|
|
uint32_t ntime;
|
|
double difficulty;
|
|
double share_diff; /* submitted hash diff */
|
|
};
|
|
|
|
inline void worker_delete(YAAMP_OBJECT *object)
|
|
{
|
|
YAAMP_WORKER *worker = (YAAMP_WORKER *)object;
|
|
delete worker;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class YAAMP_SHARE: public YAAMP_OBJECT
|
|
{
|
|
public:
|
|
int jobid;
|
|
char extranonce2[64];
|
|
char ntime[32];
|
|
char nonce[64];
|
|
char nonce1[64];
|
|
};
|
|
|
|
inline void share_delete(YAAMP_OBJECT *object)
|
|
{
|
|
YAAMP_SHARE *share = (YAAMP_SHARE *)object;
|
|
delete share;
|
|
}
|
|
|
|
//YAAMP_WORKER *share_find_worker(int userid, int workerid, int coinid, bool valid);
|
|
//void share_add_worker(int userid, int workerid, int coinid, bool valid, double difficulty);
|
|
|
|
///////////
|
|
|
|
YAAMP_SHARE *share_find(int jobid, char *extranonce2, char *ntime, char *nonce, char *nonce1);
|
|
void share_add(YAAMP_CLIENT *client, YAAMP_JOB *job, bool valid, char *extranonce2, char *ntime, char *nonce, double share_diff, int error_number);
|
|
|
|
void share_write(YAAMP_DB *db);
|
|
void share_prune(YAAMP_DB *db);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class YAAMP_BLOCK: public YAAMP_OBJECT
|
|
{
|
|
public:
|
|
time_t created;
|
|
bool confirmed;
|
|
bool segwit;
|
|
|
|
int userid;
|
|
int workerid;
|
|
int coinid;
|
|
int height;
|
|
|
|
double difficulty;
|
|
double difficulty_user;
|
|
|
|
char hash[1024];
|
|
char hash1[1024];
|
|
char hash2[1024];
|
|
};
|
|
|
|
inline void block_delete(YAAMP_OBJECT *object)
|
|
{
|
|
YAAMP_BLOCK *block = (YAAMP_BLOCK *)object;
|
|
delete block;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class YAAMP_SUBMIT: public YAAMP_OBJECT
|
|
{
|
|
public:
|
|
time_t created;
|
|
bool valid;
|
|
|
|
int remoteid;
|
|
double difficulty;
|
|
};
|
|
|
|
inline void submit_delete(YAAMP_OBJECT *object)
|
|
{
|
|
YAAMP_SUBMIT *submit = (YAAMP_SUBMIT *)object;
|
|
delete submit;
|
|
}
|
|
|
|
void block_prune(YAAMP_DB *db);
|
|
|
|
void block_add(int userid, int workerid, int coinid, int height, double diff, double diff_user, const char *hash1, const char *h2, int segwit);
|
|
void block_confirm(int coinid, const char *hash);
|
|
|
|
YAAMP_SUBMIT *submit_add(int remoteid, double difficulty);
|
|
void submit_prune(YAAMP_DB *db);
|
|
|
|
|
|
|
|
|