diff --git a/rc.local b/rc.local index 2c5f3c7..27f5a8e 100644 --- a/rc.local +++ b/rc.local @@ -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 diff --git a/stratum/coinbase.cpp b/stratum/coinbase.cpp index 89f5c1c..adb9c37 100644 --- a/stratum/coinbase.cpp +++ b/stratum/coinbase.cpp @@ -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"); diff --git a/stratum/config.sample/vanilla.conf b/stratum/config.sample/vanilla.conf new file mode 100644 index 0000000..9f65e82 --- /dev/null +++ b/stratum/config.sample/vanilla.conf @@ -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 + diff --git a/stratum/stratum.cpp b/stratum/stratum.cpp index a4e6a8c..35a4a93 100644 --- a/stratum/stratum.cpp +++ b/stratum/stratum.cpp @@ -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}, diff --git a/web/yaamp/core/functions/yaamp.php b/web/yaamp/core/functions/yaamp.php index ce547f5..855f27c 100755 --- a/web/yaamp/core/functions/yaamp.php +++ b/web/yaamp/core/functions/yaamp.php @@ -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,