Browse Source

Remove donation address

master
Sergey Markov 3 years ago
parent
commit
9823d1d708
  1. 6
      README.md
  2. 3
      src/ckpool.c
  3. 4
      src/ckpool.h
  4. 23
      src/stratifier.c

6
README.md

@ -3,11 +3,7 @@ CKPOOL + CKPROXY + libckpool by Con Kolivas
Ultra low overhead massively scalable multi-process, multi-threaded modular Ultra low overhead massively scalable multi-process, multi-threaded modular
bitcoin mining pool, proxy, passthrough, and library in c for Linux. bitcoin mining pool, proxy, passthrough, and library in c for Linux.
CKPOOL is code provided free of charge under the GPLv3 license but its development CKPOOL is code provided free of charge under the GPLv3 license
is mostly paid for by commissioned funding, and the pool by default contributes
0.5% of solved blocks in pool mode to the development team. Please consider leaving
this contribution in the code if you are running it on a pool or contributing to the
authors listed in AUTHORS if you use this code to aid funding further development.
--- ---
LICENSE: LICENSE:

3
src/ckpool.c

@ -1824,9 +1824,8 @@ int main(int argc, char **argv)
ckp.btcdpass[i] = strdup("pass"); ckp.btcdpass[i] = strdup("pass");
} }
ckp.donaddress = "14BMjogz69qe8hk9thyzbmR5pg34mVKB1e";
if (!ckp.btcaddress) if (!ckp.btcaddress)
ckp.btcaddress = ckp.donaddress; quit(0, "BTCR address is not set (config key btcaddress)");
if (!ckp.blockpoll) if (!ckp.blockpoll)
ckp.blockpoll = 100; ckp.blockpoll = 100;
if (!ckp.nonce1length) if (!ckp.nonce1length)

4
src/ckpool.h

@ -247,10 +247,6 @@ struct ckpool_instance {
bool script; // Address is a script address bool script; // Address is a script address
bool segwit; // Address is a segwit address bool segwit; // Address is a segwit address
char *btcsig; // Optional signature to add to coinbase char *btcsig; // Optional signature to add to coinbase
char *donaddress; // Donation address
bool donscript; // Donation is a script
bool donsegwit; // Donation is segwit
bool donvalid; // Donation address works on this network
/* Stratum options */ /* Stratum options */
server_instance_t **servers; server_instance_t **servers;

23
src/stratifier.c

@ -409,8 +409,6 @@ struct stratifier_data {
char txnbin[48]; char txnbin[48];
int txnlen; int txnlen;
char dontxnbin[48];
int dontxnlen;
pool_stats_t stats; pool_stats_t stats;
/* Protects changes to pool stats */ /* Protects changes to pool stats */
@ -622,11 +620,6 @@ static void generate_coinbase(const ckpool_t *ckp, workbase_t *wb)
// Generation value // Generation value
g64 = wb->coinbasevalue; g64 = wb->coinbasevalue;
if (ckp->donvalid) {
d64 = g64 / 200; // 0.5% donation
g64 -= d64; // To guarantee integers add up to the original coinbasevalue
wb->coinb2bin[wb->coinb2len++] = 2 + wb->insert_witness;
} else
wb->coinb2bin[wb->coinb2len++] = 1 + wb->insert_witness; wb->coinb2bin[wb->coinb2len++] = 1 + wb->insert_witness;
u64 = (uint64_t *)&wb->coinb2bin[wb->coinb2len]; u64 = (uint64_t *)&wb->coinb2bin[wb->coinb2len];
@ -649,16 +642,6 @@ static void generate_coinbase(const ckpool_t *ckp, workbase_t *wb)
wb->coinb2len += witnessdata_size; wb->coinb2len += witnessdata_size;
} }
if (ckp->donvalid) {
u64 = (uint64_t *)&wb->coinb2bin[wb->coinb2len];
*u64 = htole64(d64);
wb->coinb2len += 8;
wb->coinb2bin[wb->coinb2len++] = sdata->dontxnlen;
memcpy(wb->coinb2bin + wb->coinb2len, sdata->dontxnbin, sdata->dontxnlen);
wb->coinb2len += sdata->dontxnlen;
}
wb->coinb2len += 4; // Blank lock wb->coinb2len += 4; // Blank lock
wb->coinb2 = bin2hex(wb->coinb2bin, wb->coinb2len); wb->coinb2 = bin2hex(wb->coinb2bin, wb->coinb2len);
@ -2376,7 +2359,6 @@ static sdata_t *duplicate_sdata(const sdata_t *sdata)
/* Copy the transaction binaries for workbase creation */ /* Copy the transaction binaries for workbase creation */
memcpy(dsdata->txnbin, sdata->txnbin, 48); memcpy(dsdata->txnbin, sdata->txnbin, 48);
memcpy(dsdata->dontxnbin, sdata->dontxnbin, 48);
/* Use the same work queues for all subproxies */ /* Use the same work queues for all subproxies */
dsdata->ssends = sdata->ssends; dsdata->ssends = sdata->ssends;
@ -8750,11 +8732,6 @@ void *stratifier(void *arg)
/* Store this for use elsewhere */ /* Store this for use elsewhere */
hex2bin(scriptsig_header_bin, scriptsig_header, 41); hex2bin(scriptsig_header_bin, scriptsig_header, 41);
sdata->txnlen = address_to_txn(sdata->txnbin, ckp->btcaddress, ckp->script, ckp->segwit); sdata->txnlen = address_to_txn(sdata->txnbin, ckp->btcaddress, ckp->script, ckp->segwit);
if (generator_checkaddr(ckp, ckp->donaddress, &ckp->donscript, &ckp->donsegwit)) {
ckp->donvalid = true;
sdata->dontxnlen = address_to_txn(sdata->dontxnbin, ckp->donaddress, ckp->donscript, ckp->donsegwit);
}
} }
randomiser = time(NULL); randomiser = time(NULL);

Loading…
Cancel
Save