Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/evm/fix-estimategas-zero' into e…
Browse files Browse the repository at this point in the history
…vm/fix-estimategas-zero
  • Loading branch information
shohamc1 committed Nov 17, 2023
2 parents 212f202 + 1b2c3bc commit 857c70a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 4)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down
20 changes: 12 additions & 8 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,17 @@ ResVal<std::unique_ptr<CBlockTemplate>> BlockAssembler::CreateNewBlock(const CSc
assert(pindexPrev != nullptr);
nHeight = pindexPrev->nHeight + 1;

const auto myIDs = pcustomcsview->AmIOperator();
if (!myIDs) {
return Res::Err("Node has no operators");
}
const auto nodePtr = pcustomcsview->GetMasternode(myIDs->second);
if (!nodePtr || !nodePtr->IsActive(nHeight, *pcustomcsview)) {
return Res::Err("Node is not active");
std::optional<std::pair<CKeyID, uint256>> myIDs;
std::optional<CMasternode> nodePtr;
if (!blockTime) {
myIDs = pcustomcsview->AmIOperator();
if (!myIDs) {
return Res::Err("Node has no operators");
}
nodePtr = pcustomcsview->GetMasternode(myIDs->second);
if (!nodePtr || !nodePtr->IsActive(nHeight, *pcustomcsview)) {
return Res::Err("Node is not active");
}
}

auto consensus = chainparams.GetConsensus();
Expand Down Expand Up @@ -439,7 +443,7 @@ ResVal<std::unique_ptr<CBlockTemplate>> BlockAssembler::CreateNewBlock(const CSc
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->deprecatedHeight = pindexPrev->nHeight + 1;
pblock->nBits = pos::GetNextWorkRequired(pindexPrev, pblock->nTime, consensus);
if (!blockTime) {
if (myIDs) {
pblock->stakeModifier = pos::ComputeStakeModifier(pindexPrev->stakeModifier, myIDs->first);
}

Expand Down

0 comments on commit 857c70a

Please sign in to comment.