gui: bumpfee signer support

Specifically this enables the Send button in the fee bump dialog for wallets with external signer support. Similar to 2efdfb88aa.
pull/21576/head
Sjors Provoost 3 years ago
parent 7e02a33297
commit 2c07cfacd1
No known key found for this signature in database
GPG Key ID: 57FF9BDBCC301009

@ -508,7 +508,9 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
questionString.append(tr("Warning: This may pay the additional fee by reducing change outputs or adding inputs, when necessary. It may add a new change output if one does not already exist. These changes may potentially leak privacy.")); questionString.append(tr("Warning: This may pay the additional fee by reducing change outputs or adding inputs, when necessary. It may add a new change output if one does not already exist. These changes may potentially leak privacy."));
} }
auto confirmationDialog = new SendConfirmationDialog(tr("Confirm fee bump"), questionString, "", "", SEND_CONFIRM_DELAY, !m_wallet->privateKeysDisabled(), getOptionsModel()->getEnablePSBTControls(), nullptr); const bool enable_send{!wallet().privateKeysDisabled() || wallet().hasExternalSigner()};
const bool always_show_unsigned{getOptionsModel()->getEnablePSBTControls()};
auto confirmationDialog = new SendConfirmationDialog(tr("Confirm fee bump"), questionString, "", "", SEND_CONFIRM_DELAY, enable_send, always_show_unsigned, nullptr);
confirmationDialog->setAttribute(Qt::WA_DeleteOnClose); confirmationDialog->setAttribute(Qt::WA_DeleteOnClose);
// TODO: Replace QDialog::exec() with safer QDialog::show(). // TODO: Replace QDialog::exec() with safer QDialog::show().
const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec()); const auto retval = static_cast<QMessageBox::StandardButton>(confirmationDialog->exec());
@ -526,6 +528,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
// Short-circuit if we are returning a bumped transaction PSBT to clipboard // Short-circuit if we are returning a bumped transaction PSBT to clipboard
if (retval == QMessageBox::Save) { if (retval == QMessageBox::Save) {
// "Create Unsigned" clicked
PartiallySignedTransaction psbtx(mtx); PartiallySignedTransaction psbtx(mtx);
bool complete = false; bool complete = false;
const TransactionError err = wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, nullptr, psbtx, complete); const TransactionError err = wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, nullptr, psbtx, complete);
@ -541,7 +544,7 @@ bool WalletModel::bumpFee(uint256 hash, uint256& new_hash)
return true; return true;
} }
assert(!m_wallet->privateKeysDisabled()); assert(!m_wallet->privateKeysDisabled() || wallet().hasExternalSigner());
// sign bumped transaction // sign bumped transaction
if (!m_wallet->signBumpTransaction(mtx)) { if (!m_wallet->signBumpTransaction(mtx)) {

Loading…
Cancel
Save