Skip to content

Commit

Permalink
jobmaker UBTC: allow empty root state hash (00f9).
Browse files Browse the repository at this point in the history
  • Loading branch information
YihaoPeng committed Jul 25, 2018
1 parent 7e70cbd commit 3fc9ef4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Stratum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ bool StratumJob::unserializeFromJson(const char *s, size_t len) {

#ifdef CHAIN_TYPE_UBTC
// rootStateHash, optional
// rootStateHash must be at least 66 bytes
// rootStateHash must be at least 2 bytes (00f9, empty root state hash)
if (j["rootStateHash"].type() == Utilities::JS::type::Str &&
j["rootStateHash"].str().length() >= 66*2) {
j["rootStateHash"].str().length() >= 2*2) {
rootStateHash_ = j["rootStateHash"].str();
}
#endif
Expand Down Expand Up @@ -405,9 +405,9 @@ bool StratumJob::initFromGbt(const char *gbt, const string &poolCoinbaseInfo,

#ifdef CHAIN_TYPE_UBTC
// rootStateHash, optional
// default_root_state_hash must be at least 66 bytes
// default_root_state_hash must be at least 2 bytes (00f9, empty root state hash)
if (jgbt["default_root_state_hash"].type() == Utilities::JS::type::Str &&
jgbt["default_root_state_hash"].str().length() >= 66*2) {
jgbt["default_root_state_hash"].str().length() >= 2*2) {
rootStateHash_ = jgbt["default_root_state_hash"].str();
}
#endif
Expand Down

0 comments on commit 3fc9ef4

Please sign in to comment.