mirror of
https://github.com/GOSTSec/poolserver
synced 2025-01-15 01:00:10 +00:00
Better variable naming
This commit is contained in:
parent
a48cc66260
commit
1bb85e8d5d
@ -213,7 +213,7 @@ namespace Stratum
|
|||||||
BigInt target(Util::BinToASCII(Util::Reverse(hash)), 16);
|
BigInt target(Util::BinToASCII(Util::Reverse(hash)), 16);
|
||||||
|
|
||||||
// Check if difficulty meets job diff
|
// Check if difficulty meets job diff
|
||||||
if (target > job.target) {
|
if (target > job.jobTarget) {
|
||||||
sLog.Error(LOG_STRATUM, "%s: Share above target", username.c_str());
|
sLog.Error(LOG_STRATUM, "%s: Share above target", username.c_str());
|
||||||
DataMgr::Instance()->Push(Share(_ip, username, false, "Share above target", Util::Date(), job.diff));
|
DataMgr::Instance()->Push(Share(_ip, username, false, "Share above target", Util::Date(), job.diff));
|
||||||
_shareLimiter.LogBad();
|
_shareLimiter.LogBad();
|
||||||
@ -229,7 +229,7 @@ namespace Stratum
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if block meets criteria
|
// Check if block meets criteria
|
||||||
if (target <= job.blockCriteria) {
|
if (target <= job.blockTarget) {
|
||||||
sLog.Info(LOG_SERVER, "We have found a block candidate!");
|
sLog.Info(LOG_SERVER, "We have found a block candidate!");
|
||||||
|
|
||||||
if (_server->SubmitBlock(block)) {
|
if (_server->SubmitBlock(block)) {
|
||||||
@ -321,7 +321,8 @@ namespace Stratum
|
|||||||
Job job;
|
Job job;
|
||||||
job.block = _server->GetWork();
|
job.block = _server->GetWork();
|
||||||
job.diff = _diff;
|
job.diff = _diff;
|
||||||
job.target = Bitcoin::DiffToTarget(job.diff);
|
job.jobTarget = Bitcoin::DiffToTarget(job.diff);
|
||||||
|
job.blockTarget = Bitcoin::TargetFromBits(job.block->bits);
|
||||||
|
|
||||||
// Serialize transaction
|
// Serialize transaction
|
||||||
ByteBuffer coinbasebuf;
|
ByteBuffer coinbasebuf;
|
||||||
@ -338,8 +339,6 @@ namespace Stratum
|
|||||||
job.coinbase1 = BinaryData(coinbase.begin(), coinbase.begin() + cbsplit);
|
job.coinbase1 = BinaryData(coinbase.begin(), coinbase.begin() + cbsplit);
|
||||||
job.coinbase2 = BinaryData(coinbase.begin() + cbsplit + 8, coinbase.end()); // plus extranonce size
|
job.coinbase2 = BinaryData(coinbase.begin() + cbsplit + 8, coinbase.end()); // plus extranonce size
|
||||||
|
|
||||||
job.blockCriteria = Bitcoin::TargetFromBits(job.block->bits);
|
|
||||||
|
|
||||||
return job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ namespace Stratum
|
|||||||
BinaryData coinbase1;
|
BinaryData coinbase1;
|
||||||
BinaryData coinbase2;
|
BinaryData coinbase2;
|
||||||
std::set<uint64> shares;
|
std::set<uint64> shares;
|
||||||
BigInt blockCriteria;
|
BigInt blockTarget;
|
||||||
BigInt target;
|
BigInt jobTarget;
|
||||||
|
|
||||||
// Submits share to a job
|
// Submits share to a job
|
||||||
// Returns false if the same share already exists
|
// Returns false if the same share already exists
|
||||||
|
Loading…
x
Reference in New Issue
Block a user