Skip to content

Commit

Permalink
gui, psbt: Use SIGHASH_DEFAULT when signing PSBTs
Browse files Browse the repository at this point in the history
SIGHASH_DEFAULT should be used to indicate SIGHASH_DEFAULT for taproot
inputs, and SIGHASH_ALL for all other input types. This avoids adding an
unnecessary byte to the end of all Taproot signatures added to PSBTs
signed in the GUI.
  • Loading branch information
achow101 committed Jan 6, 2025
1 parent 41a2ce9 commit 3e97ff9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/qt/psbtoperationsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void PSBTOperationsDialog::signTransaction()

WalletModel::UnlockContext ctx(m_wallet_model->requestUnlock());

const auto err{m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, /*sign=*/true, /*bip32derivs=*/true, &n_signed, m_transaction_data, complete)};
const auto err{m_wallet_model->wallet().fillPSBT(SIGHASH_DEFAULT, /*sign=*/true, /*bip32derivs=*/true, &n_signed, m_transaction_data, complete)};

if (err) {
showStatus(tr("Failed to sign transaction: %1")
Expand Down

0 comments on commit 3e97ff9

Please sign in to comment.