mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
stratum: merge P2SH superblock code to prevent duplicated code
This commit is contained in:
parent
d4b00a8b0b
commit
daac1a10c6
1 changed files with 14 additions and 1 deletions
|
@ -296,7 +296,20 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *
|
|||
npayees++;
|
||||
available -= amount;
|
||||
base58_decode(payee, script_payee);
|
||||
job_pack_tx(coind, script_dests, amount, script_payee);
|
||||
bool superblock_use_p2sh = (strcmp(coind->symbol, "MAC") == 0);
|
||||
if(superblock_use_p2sh) {
|
||||
char eamount[32];
|
||||
char coinb2_part[512] = { 0 };
|
||||
char coinb2_len[4] = { 0 };
|
||||
sprintf(coinb2_part, "a9%02x%s87", (unsigned int)(strlen(script_payee) >> 1) & 0xFF, script_payee);
|
||||
sprintf(coinb2_len, "%02x", (unsigned int)(strlen(coinb2_part) >> 1) & 0xFF);
|
||||
encode_tx_value(eamount, amount);
|
||||
strcat(templ->coinb2, eamount);
|
||||
strcat(templ->coinb2, coinb2_len);
|
||||
strcat(templ->coinb2, coinb2_part);
|
||||
} else {
|
||||
job_pack_tx(coind, script_dests, amount, script_payee);
|
||||
}
|
||||
//debuglog("%s superblock %s %u\n", coind->symbol, payee, amount);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue