Skip to content

Commit

Permalink
Fix POW block sign
Browse files Browse the repository at this point in the history
  • Loading branch information
panleone committed Apr 14, 2023
1 parent e1e376e commit 1c0a068
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/blocksignature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,8 @@ bool SignBlockWithKey(CBlock& block, const CKey& key)
bool SignBlock(CBlock& block, const CKeyStore& keystore)
{
CKeyID keyID;
if (block.IsProofOfWork()) {
bool fFoundID = false;
for (const CTxOut& txout : block.vtx[0]->vout) {
if (!GetKeyIDFromUTXO(txout, keyID))
continue;
fFoundID = true;
break;
}
if (!fFoundID)
return error("%s: failed to find key for PoW", __func__);
} else {
if (!GetKeyIDFromUTXO(block.vtx[1]->vout[1], keyID))
return error("%s: failed to find key for PoS", __func__);
if (!GetKeyIDFromUTXO(block.vtx[1]->vout[1], keyID)) {
return error("%s: failed to find key for PoS", __func__);
}

CKey key;
Expand Down

0 comments on commit 1c0a068

Please sign in to comment.