mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-09-21 02:19:47 +00:00
stratum: add support for ARC 12.1 & superblocks (#89)
* stratum: add support for ARC 12.1 & superblocks
This commit is contained in:
parent
be1064a25b
commit
eae758e308
1 changed files with 43 additions and 0 deletions
|
@ -246,6 +246,49 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(strcmp(coind->symbol, "ARC") == 0)
|
||||||
|
{
|
||||||
|
char script_dests[2048] = { 0 };
|
||||||
|
char script_payee[128] = { 0 };
|
||||||
|
char payees[4];
|
||||||
|
int npayees = 1;
|
||||||
|
bool masternode_enabled = json_get_bool(json_result, "goldminenode_payments_enforced");
|
||||||
|
bool superblocks_enabled = json_get_bool(json_result, "superblocks_enabled");
|
||||||
|
json_value* superblock = json_get_array(json_result, "superblock");
|
||||||
|
json_value* masternode = json_get_object(json_result, "goldminenode");
|
||||||
|
if(superblocks_enabled && superblock) {
|
||||||
|
for(int i = 0; i < superblock->u.array.length; i++) {
|
||||||
|
const char *payee = json_get_string(superblock->u.array.values[i], "payee");
|
||||||
|
json_int_t amount = json_get_int(superblock->u.array.values[i], "amount");
|
||||||
|
if (payee && amount) {
|
||||||
|
npayees++;
|
||||||
|
available -= amount;
|
||||||
|
base58_decode(payee, script_payee);
|
||||||
|
job_pack_tx(coind, script_dests, amount, script_payee);
|
||||||
|
//debuglog("%s superblock %s %u\n", coind->symbol, payee, amount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (masternode_enabled && masternode) {
|
||||||
|
const char *payee = json_get_string(masternode, "payee");
|
||||||
|
json_int_t amount = json_get_int(masternode, "amount");
|
||||||
|
if (payee && amount) {
|
||||||
|
npayees++;
|
||||||
|
available -= amount;
|
||||||
|
base58_decode(payee, script_payee);
|
||||||
|
job_pack_tx(coind, script_dests, amount, script_payee);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sprintf(payees, "%02x", npayees);
|
||||||
|
strcat(templ->coinb2, payees);
|
||||||
|
strcat(templ->coinb2, script_dests);
|
||||||
|
job_pack_tx(coind, templ->coinb2, available, NULL);
|
||||||
|
strcat(templ->coinb2, "00000000"); // locktime
|
||||||
|
coind->reward = (double)available/100000000*coind->reward_mul;
|
||||||
|
//debuglog("%s %d dests %s\n", coind->symbol, npayees, script_dests);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
else if(coind->hasmasternodes) /* OLD DASH style */
|
else if(coind->hasmasternodes) /* OLD DASH style */
|
||||||
{
|
{
|
||||||
char charity_payee[256] = { 0 };
|
char charity_payee[256] = { 0 };
|
||||||
|
|
Loading…
Add table
Reference in a new issue