Skip to content

Commit

Permalink
pos: Prepare reserve destination for P2PWKH outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
lateminer committed Jan 10, 2024
1 parent 0f50fcd commit 3069808
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/wallet/staking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ bool CreateCoinStake(CWallet& wallet, unsigned int nBits, int64_t nSearchInterva
LogPrint(BCLog::COINSTAKE, "CreateCoinStake : no support for kernel type=%s\n", GetTxnOutputType(whichType));
break; // only support pay to public key and pay to address and pay to witness keyhash
}
if (whichType == TxoutType::PUBKEYHASH || whichType == TxoutType::WITNESS_V0_KEYHASH) // pay to address type or witness keyhash
if (whichType == TxoutType::PUBKEYHASH) // pay to address
{
// convert to pay to public key type
CKey key;
Expand Down Expand Up @@ -354,7 +354,8 @@ bool CreateCoinStake(CWallet& wallet, unsigned int nBits, int64_t nSearchInterva
}
else if (whichType == TxoutType::PUBKEY)
scriptPubKeyOut = scriptPubKeyKernel;
else if (whichType == TxoutType::WITNESS_V1_TAPROOT) {
else if (whichType == TxoutType::WITNESS_V0_KEYHASH || whichType == TxoutType::WITNESS_V1_TAPROOT) // pay to witness keyhash
{
// prepare reserve destination in case we need to use it for handling non legacy inputs
CTxDestination dest;
ReserveDestination reservedest(&wallet, OutputType::LEGACY);
Expand Down

0 comments on commit 3069808

Please sign in to comment.