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
132 lines
2.4 KiB
C++
132 lines
2.4 KiB
C++
|
|
#define MAX_AUXS 32
|
|
|
|
class YAAMP_REMOTE;
|
|
class YAAMP_COIND;
|
|
class YAAMP_COIND_AUX;
|
|
|
|
struct YAAMP_JOB_VALUES
|
|
{
|
|
char coinbase[4*1024];
|
|
char merkleroot_be[1024];
|
|
|
|
char header[1024];
|
|
char header_be[1024];
|
|
unsigned char header_bin[1024];
|
|
|
|
char hash_hex[1024];
|
|
char hash_be[1024];
|
|
unsigned char hash_bin[1024];
|
|
};
|
|
|
|
struct YAAMP_JOB_TEMPLATE
|
|
{
|
|
int created;
|
|
char flags[64];
|
|
|
|
char prevhash_hex[1024];
|
|
char prevhash_be[1024];
|
|
|
|
char claim_hex[128];
|
|
char claim_be[128];
|
|
|
|
int txcount;
|
|
char txmerkles[YAAMP_SMALLBUFSIZE];
|
|
|
|
vector<string> txsteps;
|
|
vector<string> txdata;
|
|
|
|
char version[32];
|
|
char nbits[32];
|
|
char ntime[32];
|
|
|
|
int height;
|
|
int target;
|
|
|
|
json_int_t value;
|
|
|
|
char coinb1[4*1024];
|
|
char coinb2[4*1024];
|
|
|
|
char header[256];
|
|
|
|
bool has_segwit_txs;
|
|
|
|
int auxs_size;
|
|
YAAMP_COIND_AUX *auxs[MAX_AUXS];
|
|
};
|
|
|
|
#define YAAMP_JOB_MAXSUBIDS 200
|
|
|
|
class YAAMP_JOB: public YAAMP_OBJECT
|
|
{
|
|
public:
|
|
bool block_found;
|
|
char name[1024];
|
|
|
|
int count;
|
|
double speed;
|
|
|
|
double maxspeed;
|
|
double profit;
|
|
|
|
YAAMP_COIND *coind; // either one of them
|
|
YAAMP_REMOTE *remote;
|
|
YAAMP_JOB_TEMPLATE *templ;
|
|
|
|
bool remote_subids[YAAMP_JOB_MAXSUBIDS];
|
|
};
|
|
|
|
inline void job_delete(YAAMP_OBJECT *object)
|
|
{
|
|
YAAMP_JOB *job = (YAAMP_JOB *)object;
|
|
if (!job) return;
|
|
if (job->templ && job->templ->txcount) {
|
|
job->templ->txsteps.clear();
|
|
job->templ->txdata.clear();
|
|
}
|
|
if (job->templ) delete job->templ;
|
|
delete job;
|
|
}
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
int job_get_jobid();
|
|
|
|
void job_sort();
|
|
void job_relock_clients(int jobid_old, int jobid_new);
|
|
void job_unlock_clients(YAAMP_JOB *job=NULL);
|
|
void job_assign_locked_clients(YAAMP_JOB *job);
|
|
|
|
bool job_can_mine(YAAMP_JOB *job);
|
|
void job_reset_clients(YAAMP_JOB *job=NULL);
|
|
bool job_has_free_client();
|
|
|
|
//YAAMP_JOB_TEMPLATE *job_create_template(YAAMP_COIND *coind);
|
|
//void job_create_last(YAAMP_COIND *coind, bool force=false);
|
|
|
|
/////////////////////////
|
|
|
|
void job_send_jobid(YAAMP_CLIENT *client, int jobid);
|
|
void job_send_last(YAAMP_CLIENT *client);
|
|
void job_broadcast(YAAMP_JOB *job);
|
|
|
|
/////////////////////////
|
|
|
|
void *job_thread(void *p);
|
|
void job_signal();
|
|
void job_update();
|
|
void job_init();
|
|
|
|
|
|
void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *json_result);
|
|
|
|
vector<string> coind_aux_hashlist(YAAMP_COIND_AUX **auxs, int size);
|
|
vector<string> coind_aux_merkle_branch(YAAMP_COIND_AUX **auxs, int size, int index);
|
|
void coind_aux_build_auxs(YAAMP_JOB_TEMPLATE *templ);
|
|
|
|
|
|
|
|
|
|
|
|
|