@@ -53,7 +53,7 @@ class FarmClient : public jsonrpc::Client
53
53
) : jsonrpc::Client(conn, type)
54
54
{
55
55
m_opMode = _opMode;
56
- m_userAcct = ProgOpt::Get (" 0xBitcoin" , " MinerAcct" );
56
+ userAcct = ProgOpt::Get (" 0xBitcoin" , " MinerAcct" );
57
57
if (_opMode == OperationMode::Solo)
58
58
{
59
59
m_tokenContract = ProgOpt::Get (" 0xBitcoin" , " TokenContract" );
@@ -72,7 +72,7 @@ class FarmClient : public jsonrpc::Client
72
72
Json::Value result;
73
73
result = CallMethod (" getChallengeNumber" , data);
74
74
_challenge = fromHex (result.asString ());
75
- data.append (m_userAcct );
75
+ data.append (userAcct );
76
76
result = CallMethod (" getMinimumShareTarget" , data);
77
77
m_target = u256 (result.asString ());
78
78
@@ -96,7 +96,7 @@ class FarmClient : public jsonrpc::Client
96
96
{
97
97
// challenge
98
98
Json::Value p;
99
- p[" from" ] = m_userAcct ;
99
+ p[" from" ] = userAcct ;
100
100
p[" to" ] = m_tokenContract;
101
101
102
102
h256 bMethod = sha3 (" getChallengeNumber()" );
@@ -147,7 +147,7 @@ class FarmClient : public jsonrpc::Client
147
147
148
148
Json::Value data;
149
149
data.append (" 0x" + _nonce.hex ());
150
- data.append (devFeeMining ? DonationAddress : m_userAcct );
150
+ data.append (devFeeMining ? DonationAddress : userAcct );
151
151
data.append (" 0x" + toHex (_hash));
152
152
Json::Value::UInt64 diff = static_cast <Json::Value::UInt64>(m_difficulty);
153
153
data.append (diff);
@@ -196,12 +196,9 @@ class FarmClient : public jsonrpc::Client
196
196
// prepare transaction
197
197
Transaction t;
198
198
if (m_lastSolution.elapsedSeconds () > 5 * 60 || m_txNonce == -1 )
199
- {
200
199
m_txNonce = getNextNonce ();
201
- } else
202
- {
200
+ else
203
201
m_txNonce++;
204
- }
205
202
m_lastSolution.restart ();
206
203
t.nonce = m_txNonce;
207
204
t.receiveAddress = toAddress (m_tokenContract);
@@ -389,15 +386,15 @@ class FarmClient : public jsonrpc::Client
389
386
int getNextNonce () {
390
387
// get transaction count for nonce
391
388
Json::Value p;
392
- p.append (m_userAcct );
389
+ p.append (userAcct );
393
390
p.append (" latest" );
394
391
Json::Value result = CallMethod (" eth_getTransactionCount" , p);
395
392
return HexToInt (result.asString ());
396
393
}
397
394
398
395
uint64_t tokenBalance () {
399
396
Json::Value p;
400
- p[" from" ] = m_userAcct ;
397
+ p[" from" ] = userAcct ;
401
398
p[" to" ] = m_tokenContract;
402
399
403
400
h256 bMethod = sha3 (" balanceOf(address)" );
@@ -406,7 +403,7 @@ class FarmClient : public jsonrpc::Client
406
403
407
404
// address
408
405
stringstream ss;
409
- ss << std::setw (64 ) << std::setfill (' 0' ) << m_userAcct .substr (2 );
406
+ ss << std::setw (64 ) << std::setfill (' 0' ) << userAcct .substr (2 );
410
407
std::string s2 (ss.str ());
411
408
sMethod = sMethod + s2;
412
409
p[" data" ] = sMethod ;
@@ -460,7 +457,7 @@ class FarmClient : public jsonrpc::Client
460
457
u256 recommendation = 0 ;
461
458
for (auto m : m_biddingMiners)
462
459
{
463
- if (m.challenge == _challenge && stricmp (m.account .c_str (), m_userAcct .c_str ()) != 0 )
460
+ if (m.challenge == _challenge && stricmp (m.account .c_str (), userAcct .c_str ()) != 0 )
464
461
{
465
462
LogF << " Trace: RecommendedGasPrice, existing bidder " << m.account .substr (0 ,10 ) << " , gasPrice=" << m.gasPrice ;
466
463
if (m.gasPrice > recommendation)
@@ -618,10 +615,10 @@ class FarmClient : public jsonrpc::Client
618
615
619
616
public:
620
617
bool devFeeMining = false ;
618
+ string userAcct;
621
619
622
620
private:
623
621
OperationMode m_opMode;
624
- string m_userAcct;
625
622
string m_userAcctPK;
626
623
string m_tokenContract;
627
624
int m_txNonce = -1 ;
0 commit comments