If sign is true, transaction must previously have been filled
| 62 | |
| 63 | // If sign is true, transaction must previously have been filled |
| 64 | TransactionError ExternalSignerScriptPubKeyMan::FillPSBT(PartiallySignedTransaction& psbt, const PrecomputedTransactionData& txdata, int sighash_type, bool sign, bool bip32derivs, int* n_signed, bool finalize) const |
| 65 | { |
| 66 | if (!sign) { |
| 67 | return DescriptorScriptPubKeyMan::FillPSBT(psbt, txdata, sighash_type, false, bip32derivs, n_signed, finalize); |
| 68 | } |
| 69 | |
| 70 | // Already complete if every input is now signed |
| 71 | bool complete = true; |
| 72 | for (const auto& input : psbt.inputs) { |
| 73 | // TODO: for multisig wallets, we should only care if all _our_ inputs are signed |
| 74 | complete &= PSBTInputSigned(input); |
| 75 | } |
| 76 | if (complete) return TransactionError::OK; |
| 77 | |
| 78 | std::string strFailReason; |
| 79 | if(!GetExternalSigner().SignTransaction(psbt, strFailReason)) { |
| 80 | tfm::format(std::cerr, "Failed to sign: %s\n", strFailReason); |
| 81 | return TransactionError::EXTERNAL_SIGNER_FAILED; |
| 82 | } |
| 83 | if (finalize) FinalizePSBT(psbt); // This won't work in a multisig setup |
| 84 | return TransactionError::OK; |
| 85 | } |
| 86 | } // namespace wallet |
nothing calls this directly
no test coverage detected