You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (whichType == TxoutType::PUBKEYHASH || whichType == TxoutType::WITNESS_V0_KEYHASH) { //this code could be removed in the future to allow block signing with any arbitrary pubkey
5759
+
if (whichType == TxoutType::PUBKEYHASH || whichType == TxoutType::WITNESS_V0_KEYHASH) { //we need to ensure the signing pubkey belongs to the original staker so that the coinstake TX cannot be used by someone else to create a different block
5760
5760
if (Hash160(pubkey) != uint160(vSolutions[0])) {
5761
5761
returnerror("%s : pubkey used for block signature (%s) does not correspond to first output", __func__, HexStr(pubkey));
5762
5762
}
5763
5763
} else
5764
5764
returnerror("%s : unable to verify pubkey belongs to first output of type=%s", __func__, GetTxnOutputType(whichType));
5765
+
} elseif ((fProofOfStake && block.vtx[1]->vout.size() > 2) || (!fProofOfStake && block.vtx[0]->vout.size() > 1)) { // check for pubkey in OP_RETURN output - this can be any arbitrary pubkey as it will be covered by the coinstake TX signature hash
5766
+
for (const CTxOut& out : block.vtx[fProofOfStake]->vout) {
0 commit comments