Add support for VNL blake

This commit is contained in:
Tanguy Pruvot 2016-01-27 02:03:50 +01:00
parent 9d1c34f894
commit d9d1be135e
5 changed files with 58 additions and 6 deletions

View file

@ -38,6 +38,8 @@ screen -dmS lyra2 $STRATUM_DIR/run.sh lyra2
screen -dmS lyra2v2 $STRATUM_DIR/run.sh lyra2v2
screen -dmS blake $STRATUM_DIR/run.sh blake
screen -dmS vanilla $STRATUM_DIR/run.sh vanilla # blake 8
#screen -dmS keccak $STRATUM_DIR/run.sh keccak
screen -dmS whirlpool $STRATUM_DIR/run.sh whirlpool

View file

@ -114,9 +114,9 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *
// 2 txs are required on these coins, one for foundation (dev fees)
if(coind->charity_percent)
{
char charity_payee[1024] = { 0 };
char charity_payee[512] = { 0 };
const char *payee = json_get_string(json_result, "payee");
if (payee) snprintf(charity_payee, 1023, "%s", payee);
if (payee) snprintf(charity_payee, 511, "%s", payee);
else sprintf(charity_payee, "%s", coind->charity_address);
if (strlen(charity_payee) == 0)
stratumlog("ERROR %s has no charity_address set!\n", coind->name);
@ -137,12 +137,40 @@ void coinbase_create(YAAMP_COIND *coind, YAAMP_JOB_TEMPLATE *templ, json_value *
return;
}
// if(strcmp(coind->symbol, "DASH") == 0)
if(coind->hasmasternodes)
if(strcmp(coind->symbol, "VNL") == 0)
{
char charity_payee[1024] = { 0 };
char charity_payee[512];
json_value* incentive = json_get_object(json_result, "incentive");
if (incentive) {
const char* payee = json_get_string(incentive, "address");
if (payee) snprintf(charity_payee, 511, "%s", payee);
else sprintf(charity_payee, "%s", coind->charity_address);
bool enforced = json_get_bool(incentive, "enforced");
json_int_t charity_amount = json_get_int(incentive, "amount");
if (enforced && charity_amount && strlen(charity_payee)) {
char script_payee[1024];
base58_decode(charity_payee, script_payee);
strcat(templ->coinb2, "02");
job_pack_tx(coind, templ->coinb2, available, NULL);
job_pack_tx(coind, templ->coinb2, charity_amount, script_payee);
strcat(templ->coinb2, "00000000"); // locktime
coind->charity_amount = charity_amount;
coind->reward = (double)available/100000000*coind->reward_mul;
//debuglog("VNL coinbase %ld (+%ld incentive to %s)\n",
// (long) available, (long) charity_amount, charity_payee);
return;
}
}
}
if(coind->hasmasternodes) /* DASH style */
{
char charity_payee[512] = { 0 };
const char *payee = json_get_string(json_result, "payee");
if (payee) snprintf(charity_payee, 1023, "%s", payee);
if (payee) snprintf(charity_payee, 511, "%s", payee);
json_int_t charity_amount = json_get_int(json_result, "payee_amount");
bool charity_payments = json_get_bool(json_result, "masternode_payments");

View file

@ -0,0 +1,16 @@
[TCP]
server = yaamp.com
port = 5755
password = tu8tu5
[SQL]
host = yaampdb
database = yaamp
username = root
password = patofpaq
[STRATUM]
algo = vanilla
difficulty = 5
max_ttf = 4000000

View file

@ -98,6 +98,8 @@ YAAMP_ALGO g_algos[] =
{"blake", blake_hash, 1, 0 },
{"blakecoin", blakecoin_hash, 0x100, 0, sha256_hash_hex },
{"vanilla", blakecoin_hash, 1, 0 },
{"fresh", fresh_hash, 0x100, 0, 0},
{"quark", quark_hash, 1, 0, 0},
{"nist5", nist5_hash, 1, 0, 0},

View file

@ -29,8 +29,10 @@ function yaamp_get_algos()
'sib',
'skein',
'skein2',
'vanilla',
'velvet',
'yescrypt',
'whirlpool',
'zr5',
);
}
@ -101,6 +103,7 @@ function getAlgoColors($algo)
'sib' => '#a0a0c0',
'skein' => '#80a0a0',
'skein2' => '#c8a060',
'vanilla' => '#f0f0f0',
'velvet' => '#aac0cc',
'whirlpool' => '#d0e0e0',
'yescrypt' => '#e0d0e0',
@ -147,6 +150,7 @@ function getAlgoPort($algo)
'zr5' => 5533,
// 5555 to 5683 reserved
'blake' => 5733,
'vanilla' => 5755,
'penta' => 5833,
'luffa' => 5933,
'm7m' => 6033,