mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Give more descriptive error for non-WSH(OP_TRUE) block generation
This commit is contained in:
parent
ee14d88de2
commit
3a2888ccad
1 changed files with 6 additions and 4 deletions
|
|
@ -142,11 +142,13 @@ UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGen
|
|||
}
|
||||
}
|
||||
|
||||
// Fill out block witness if dynamic federation is enabled
|
||||
// since we are assuming WSH(OP_TRUE)
|
||||
if (!pblock->m_dynafed_params.IsNull()) {
|
||||
CScript op_true(OP_TRUE);
|
||||
// Handle OP_TRUE m_signblockscript case
|
||||
CScript op_true(OP_TRUE);
|
||||
if (pblock->m_dynafed_params.m_current.m_signblockscript ==
|
||||
GetScriptForDestination(WitnessV0ScriptHash(op_true))) {
|
||||
pblock->m_signblock_witness.stack.push_back(std::vector<unsigned char>(op_true.begin(), op_true.end()));
|
||||
} else if (!pblock->m_dynafed_params.IsNull()) {
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Unable to fill out dynamic federation signblockscript witness, are you sure it's WSH(OP_TRUE)?");
|
||||
}
|
||||
|
||||
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(*pblock);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue