Skip to content

Commit

Permalink
Merge #2451: [Backport] wallet fix segfault for P2CS inputs in Create…
Browse files Browse the repository at this point in the history
…Transaction

61a48b2 wallet: fix segfault in CreateTransaction, do not try to access to a nullptr fStakeDelegationVoided if it's not provided. (furszy)

Pull request description:

  Backport #2450 to 5.2 branch.

ACKs for top commit:
  Fuzzbawls:
    utACK 61a48b2
  random-zebra:
    utACK 61a48b2

Tree-SHA512: 20872f867329992c9e23541ab11c6834b9f7f110d0669ef5f4283a75d6b5ac2a9d2eb1fb5026424c7e1494f9e2ca1114aedfec7eac7c8ce17cf0982399bf1265
  • Loading branch information
random-zebra committed Jun 25, 2021
2 parents 1c88c1f + 61a48b2 commit 51cfe31
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,7 +3015,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend,

// Fill vin
for (const std::pair<const CWalletTx*, unsigned int>& coin : setCoins) {
if(coin.first->tx->vout[coin.second].scriptPubKey.IsPayToColdStaking()) {
if(fStakeDelegationVoided && coin.first->tx->vout[coin.second].scriptPubKey.IsPayToColdStaking()) {
*fStakeDelegationVoided = true;
}
txNew.vin.emplace_back(coin.first->GetHash(), coin.second);
Expand Down

0 comments on commit 51cfe31

Please sign in to comment.