Skip to content

Commit e1cd9fe

Browse files
Merge branch 'MickdeGraaf-master'
2 parents a3a0f32 + 970a521 commit e1cd9fe

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

ethminer/FarmClient.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class FarmClient : public jsonrpc::Client
4545

4646
// Constructor
4747
FarmClient(
48-
jsonrpc::IClientConnector &conn,
48+
jsonrpc::IClientConnector &conn,
4949
OperationMode _opMode,
5050
std::string _userAcct,
5151
jsonrpc::clientVersion_t type = jsonrpc::JSONRPC_CLIENT_V2
@@ -96,8 +96,8 @@ class FarmClient : public jsonrpc::Client
9696
_target = m_target;
9797
_difficulty = m_difficulty;
9898
_hashingAcct = m_hashingAcct;
99-
LogF << "Trace: getWorkPool - challenge:" << toHex(_challenge).substr(0, 8)
100-
<< ", target:" << std::hex << std::setw(16) << std::setfill('0') << upper64OfHash(_target)
99+
LogF << "Trace: getWorkPool - challenge:" << toHex(_challenge).substr(0, 8)
100+
<< ", target:" << std::hex << std::setw(16) << std::setfill('0') << upper64OfHash(_target)
101101
<< ", difficulty:" << std::dec << _difficulty;
102102
}
103103

@@ -134,8 +134,8 @@ class FarmClient : public jsonrpc::Client
134134
{
135135
// challenge
136136
Json::Value p;
137-
p["from"] = m_userAcct;
138-
p["to"] = m_tokenContract;
137+
p["from"] = m_userAcct;
138+
p["to"] = m_tokenContract;
139139

140140
h256 bMethod = sha3("getChallengeNumber()");
141141
std::string sMethod = toHex(bMethod, dev::HexPrefix::Add);
@@ -166,7 +166,7 @@ class FarmClient : public jsonrpc::Client
166166
if (result.isString())
167167
{
168168
_target = h256(result.asString());
169-
}
169+
}
170170
else
171171
throw jsonrpc::JsonRpcException(jsonrpc::Errors::ERROR_CLIENT_INVALID_RESPONSE, result.toStyledString());
172172

@@ -235,8 +235,8 @@ class FarmClient : public jsonrpc::Client
235235
m_lastSolution.restart();
236236
t.nonce = m_txNonce;
237237
t.receiveAddress = toAddress(m_tokenContract);
238-
t.gas = u256(200000);
239238
ProgOpt::Reload();
239+
t.gas = atoi(ProgOpt::Get("0xBitcoin", "GasLimit").c_str());
240240
m_startGas = atoi(ProgOpt::Get("0xBitcoin", "GasPrice").c_str());
241241
m_maxGas = atoi(ProgOpt::Get("0xBitcoin", "MaxGasPrice").c_str());
242242
t.gasPrice = RecommendedGasPrice(_challenge);
@@ -272,7 +272,7 @@ class FarmClient : public jsonrpc::Client
272272
}
273273

274274
// this routine runs on a separate thread
275-
void txpoolScanner()
275+
void txpoolScanner()
276276
{
277277
Json::Value data;
278278
Json::Value result;
@@ -363,7 +363,7 @@ class FarmClient : public jsonrpc::Client
363363
}
364364

365365
// we've only got the hashes at this point, so now retrieve each tx
366-
for (uint32_t i = 0; i < result.size(); i++)
366+
for (uint32_t i = 0; i < result.size(); i++)
367367
{
368368
string hash = result[i].asString();
369369
data.clear();
@@ -395,7 +395,7 @@ class FarmClient : public jsonrpc::Client
395395
}
396396
}
397397
}
398-
LogD << "Miner " << miner.account.substr(0, 10) << " submitted tx " << miner.txHash.substr(0, 10)
398+
LogD << "Miner " << miner.account.substr(0, 10) << " submitted tx " << miner.txHash.substr(0, 10)
399399
<< ". gasPrice=" << miner.gasPrice << ", challenge=" << toHex(miner.challenge).substr(0, 8);
400400
m_biddingMiners.push_back(miner);
401401
}
@@ -427,8 +427,8 @@ class FarmClient : public jsonrpc::Client
427427

428428
uint64_t tokenBalance() {
429429
Json::Value p;
430-
p["from"] = m_userAcct;
431-
p["to"] = m_tokenContract;
430+
p["from"] = m_userAcct;
431+
p["to"] = m_tokenContract;
432432

433433
h256 bMethod = sha3("balanceOf(address)");
434434
std::string sMethod = toHex(bMethod, dev::HexPrefix::Add);
@@ -530,22 +530,22 @@ class FarmClient : public jsonrpc::Client
530530
{
531531
needsDeleting.push_back(t.challenge);
532532
LogB << "Tx " << t.txHash.substr(0, 10) << " failed, gasPrice = " << t.gasPrice / 1000000000 << " :(";
533-
}
533+
}
534534
else if (status == Waiting)
535535
{
536536
// adjust gas price if necessary
537537
u256 recommended = RecommendedGasPrice(t.challenge);
538538
if (t.gasPrice < recommended)
539539
{
540540
// increase gas price and resend
541-
// but first make a copy of existing tx. we can't be sure if the old one will get replaced
541+
// but first make a copy of existing tx. we can't be sure if the old one will get replaced
542542
// by the new one, before one or the other gets mined.
543543
t.gasPrice = recommended;
544544
txSignSend(t);
545545
m_pendingTxs.push_back(t);
546546
LogB << "Adjusting gas price to " << t.gasPrice / 1000000000 << ", new tx hash=" << t.txHash;
547547
}
548-
}
548+
}
549549
}
550550

551551
for (auto challenge : needsDeleting)
@@ -566,7 +566,7 @@ class FarmClient : public jsonrpc::Client
566566
ss = std::stringstream();
567567
ss << "0x" << toHex(t.rlp());
568568

569-
// submit to the node
569+
// submit to the node
570570
Json::Value p;
571571
p.append(ss.str());
572572
Json::Value result = CallMethod("eth_sendRawTransaction", p);
@@ -579,7 +579,7 @@ class FarmClient : public jsonrpc::Client
579579
std::vector<byte> mix(84);
580580
std::ostringstream ss;
581581
Json::Value p;
582-
p["from"] = _sender;
582+
p["from"] = _sender;
583583
p["to"] = m_tokenContract; // 0xbitcoin contract address
584584

585585
// function signature

tokenminer.ini

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
[Node]
66

77
; If you are pool mining, set the Host and Port to that of your mining pool.
8-
; If you are solo mining, set the Host and Port to that of your node. You can
8+
; If you are solo mining, set the Host and Port to that of your node. You can
99
; also set these with the -N command line paramater. The command line overrides
1010
; settings specified here
1111
;
1212
; Examples, POOL MINING:
13-
; Host=http://your_mining_pool.com
13+
; Host=http://your_mining_pool.com
1414
; RPCPort=8586
1515
; Examples, SOLO MINING:
1616
; Host=127.0.0.1
@@ -25,7 +25,7 @@ RPCPort=8586
2525

2626
; Secondary (failover) node/mining pool, if you have one. Default is disabled.
2727

28-
; Host=http://your_failover_mining_pool.com
28+
; Host=http://your_failover_mining_pool.com
2929
; RPCPort=8586
3030

3131
;--------------------------------------------------------
@@ -37,14 +37,14 @@ RPCPort=8586
3737
; SOLO MINING: Your ETH account and private key. Note the PK does NOT start
3838
; with 0x. Mining rewards will be deposited to this account. Transaction
3939
; fees will be DRAWN from this account. Make sure you have enough funds!!
40-
; If you have multiple mining rigs, make sure each rig is running under a
40+
; If you have multiple mining rigs, make sure each rig is running under a
4141
; separate ETH account, to prevent nonce collisions if they happen to submit
42-
; txs at nearly the same time.
42+
; txs at nearly the same time.
4343

4444
MinerAcct=0x........................................
4545
AcctPK=................................................................
4646

47-
; Difficulty assignment. Defaults to Pool assigned. You can also
47+
; Difficulty assignment. Defaults to Pool assigned. You can also
4848
; specify a value in minutes to have the miner self-assign a difficulty
4949
; level to target an average number of minutes per share.
5050
; Currently, no mining pools support self-assigned difficulty.
@@ -55,7 +55,7 @@ TokenContract=0xb6ed7644c69416d67b522e20bc294a9a9b405b31
5555

5656
; THE REMAINING SETTINGS IN THIS SECTION APPLY ONLY TO SOLO MINING:
5757

58-
; when your miner finds a solution, transactions will be submitted with this
58+
; when your miner finds a solution, transactions will be submitted with this
5959
; amount of gas (gwei). You can change this setting 'on the fly' (without having
6060
; to restart the miner). All other setting changes require the miner to be restarted.
6161
GasPrice=5
@@ -70,6 +70,9 @@ GasPriceBidding=0
7070
; max gas price you're willing to bid up to
7171
MaxGasPrice=35
7272

73+
; gas limit used when submitting solution
74+
GasLimit=200000
75+
7376
; the # of gwei to top the highest bidder
7477
BidTop=2
7578

0 commit comments

Comments
 (0)