MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SignTransaction

Function SignTransaction

src/wallet/feebumper.cpp:332–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330}
331
332bool SignTransaction(CWallet& wallet, CMutableTransaction& mtx) {
333 LOCK(wallet.cs_wallet);
334
335 if (wallet.IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) {
336 // Make a blank psbt
337 PartiallySignedTransaction psbtx(mtx);
338
339 // First fill transaction with our data without signing,
340 // so external signers are not asked to sign more than once.
341 bool complete;
342 wallet.FillPSBT(psbtx, {.sign = false, .bip32_derivs = true}, complete);
343 auto err{wallet.FillPSBT(psbtx, {.sign = true, .bip32_derivs = false}, complete)};
344 if (err) return false;
345 complete = FinalizeAndExtractPSBT(psbtx, mtx);
346 return complete;
347 } else {
348 return wallet.SignTransaction(mtx);
349 }
350}
351
352Result CommitTransaction(CWallet& wallet, const Txid& txid, CMutableTransaction&& mtx, std::vector<bilingual_str>& errors, Txid& bumped_txid)
353{

Callers 5

SignTransactionMethod · 0.70
SignTransactionMethod · 0.70
signBumpTransactionMethod · 0.70
TestSimpleSpendFunction · 0.50
bumpfee_helperFunction · 0.50

Calls 4

FinalizeAndExtractPSBTFunction · 0.85
IsWalletFlagSetMethod · 0.80
FillPSBTMethod · 0.45
SignTransactionMethod · 0.45

Tested by 1

TestSimpleSpendFunction · 0.40