Skip to content

Commit 86d361e

Browse files
committed
fix: disable precommitment for local testing
1 parent c452529 commit 86d361e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/node/miner.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
184184
int resize = 2;
185185
CMutableTransaction coinbaseTx;
186186
std::vector<AnduroPreCommitment> pending_commitments = listPendingCommitment(nHeight);
187-
// if(Params().GetChainType() != ChainType::REGTEST) {
187+
if(Params().GetChainType() != ChainType::REGTEST) {
188188
// get next block presigned data
189189
LogPrintf("commitment queue count %i\n", pending_commitments.size());
190190
// prevent to get block template if not presigned signature available for next block
@@ -214,10 +214,10 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
214214
pblock->currentKeys = getCurrentKeys(m_chainstate.m_chainman);
215215
pblock->currentIndex = getCurrentIndex(m_chainstate.m_chainman);
216216
}
217-
// } else {
218-
// pblock->currentKeys = getCurrentKeys(m_chainstate.m_chainman);
219-
// pblock->currentIndex = getCurrentIndex(m_chainstate.m_chainman);
220-
// }
217+
} else {
218+
pblock->currentKeys = getCurrentKeys(m_chainstate.m_chainman);
219+
pblock->currentIndex = getCurrentIndex(m_chainstate.m_chainman);
220+
}
221221

222222
coinbaseTx.vin.resize(1);
223223
coinbaseTx.vin[0].prevout.SetNull();
@@ -231,7 +231,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
231231
coinbaseTx.vout[oIncr].scriptPubKey = getMinerScript(m_chainstate.m_chainman, nHeight);
232232
coinbaseTx.vout[oIncr].nValue = minerFee;
233233

234-
// if(Params().GetChainType() != ChainType::REGTEST) {
234+
if(Params().GetChainType() != ChainType::REGTEST) {
235235
// including anduro signature information
236236
std::string preCommitmentWitness = "";
237237
if(nHeight > 2) {
@@ -241,7 +241,7 @@ std::unique_ptr<CBlockTemplate> BlockAssembler::CreateNewBlock()
241241
std::vector<unsigned char> data = ParseHex(preCommitmentWitness);
242242
CTxOut out(0, CScript() << OP_RETURN << data);
243243
coinbaseTx.vout[oIncr] = out;
244-
// }
244+
}
245245

246246

247247
Assert(nHeight > 0);

src/validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2126,9 +2126,9 @@ bool CheckParentProofOfWork(uint256 hash, unsigned int nBits)
21262126

21272127
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams)
21282128
{
2129-
// if(Params().GetChainType() != ChainType::REGTEST) {
2129+
if(Params().GetChainType() != ChainType::REGTEST) {
21302130
return 0;
2131-
// }
2131+
}
21322132
int halvings = nHeight / consensusParams.nSubsidyHalvingInterval;
21332133
// Force block reward to zero when right shift is undefined.
21342134
if (halvings >= 64)

0 commit comments

Comments
 (0)