MCPcopy Create free account
hub / github.com/ElementsProject/elements / signWithExternalSigner

Method signWithExternalSigner

src/qt/sendcoinsdialog.cpp:460–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

458}
459
460bool SendCoinsDialog::signWithExternalSigner(PartiallySignedTransaction& psbtx, CMutableTransaction& mtx, bool& complete) {
461 TransactionError err;
462 try {
463 err = model->wallet().fillPSBT(SIGHASH_ALL, /*sign=*/true, /*bip32derivs=*/true, /*n_signed=*/nullptr, psbtx, complete);
464 } catch (const std::runtime_error& e) {
465 QMessageBox::critical(nullptr, tr("Sign failed"), e.what());
466 return false;
467 }
468 if (err == TransactionError::EXTERNAL_SIGNER_NOT_FOUND) {
469 //: "External signer" means using devices such as hardware wallets.
470 QMessageBox::critical(nullptr, tr("External signer not found"), "External signer not found");
471 return false;
472 }
473 if (err == TransactionError::EXTERNAL_SIGNER_FAILED) {
474 //: "External signer" means using devices such as hardware wallets.
475 QMessageBox::critical(nullptr, tr("External signer failure"), "External signer failure");
476 return false;
477 }
478 if (err != TransactionError::OK) {
479 tfm::format(std::cerr, "Failed to sign PSBT");
480 processSendCoinsReturn(WalletModel::TransactionCreationFailed);
481 return false;
482 }
483 // fillPSBT does not always properly finalize
484 complete = FinalizeAndExtractPSBT(psbtx, mtx);
485 return true;
486}
487
488void SendCoinsDialog::sendButtonClicked([[maybe_unused]] bool checked)
489{

Callers

nothing calls this directly

Calls 4

FinalizeAndExtractPSBTFunction · 0.85
fillPSBTMethod · 0.80
formatFunction · 0.50
walletMethod · 0.45

Tested by

no test coverage detected