mirror of
https://github.com/LBRYFoundation/pool.git
synced 2025-08-23 17:37:25 +00:00
stratum: support for MAC P2SH masternodes too (#266)
note: a field "isscript" should be added to getblocktemplate masternode/superblock objects if the type of address can vary over time... Code may be refactored later (common func and p2sh fields in coind object)
This commit is contained in:
parent
db7a145c0b
commit
ed97818e61
1 changed files with 14 additions and 1 deletions
|
@ -321,7 +321,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 masternode_use_p2sh = (strcmp(coind->symbol, "MAC") == 0);
|
||||
if(masternode_use_p2sh) {
|
||||
char eamount[32] = { 0 };
|
||||
char coinb2_part[256];
|
||||
char coinb2_len[4];
|
||||
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(script_dests, eamount);
|
||||
strcat(script_dests, coinb2_len);
|
||||
strcat(script_dests, coinb2_part);
|
||||
} else {
|
||||
job_pack_tx(coind, script_dests, amount, script_payee);
|
||||
}
|
||||
}
|
||||
}
|
||||
sprintf(payees, "%02x", npayees);
|
||||
|
|
Loading…
Add table
Reference in a new issue