Skip to content

Commit

Permalink
stratum: fix superblock script order
Browse files Browse the repository at this point in the history
was not easy to code without the future wallet code to test it ;)
  • Loading branch information
tpruvot committed May 7, 2018
1 parent d428130 commit db7a145
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions stratum/coinbase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,15 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *
base58_decode(payee, 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 };
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(templ->coinb2, eamount);
strcat(templ->coinb2, coinb2_len);
strcat(templ->coinb2, coinb2_part);
strcat(script_dests, eamount);
strcat(script_dests, coinb2_len);
strcat(script_dests, coinb2_part);
} else {
job_pack_tx(coind, script_dests, amount, script_payee);
}
Expand Down

0 comments on commit db7a145

Please sign in to comment.