diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2022-04-25 18:13:23 +0200 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2022-04-25 18:13:23 +0200 |
commit | 7e02a3329797211ed5d35e5f5e7b919c099b78ba (patch) | |
tree | 981ae5a80201d8e464f4e4782ed6e053b96b52ec /src/wallet/feebumper.cpp | |
parent | 304ece994504220c355577170409b9200941f2af (diff) | |
download | bitcoin-7e02a3329797211ed5d35e5f5e7b919c099b78ba.tar.xz |
rpc: bumpfee signer support
Diffstat (limited to 'src/wallet/feebumper.cpp')
-rw-r--r-- | src/wallet/feebumper.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp index 73042424ad..c66754bfcb 100644 --- a/src/wallet/feebumper.cpp +++ b/src/wallet/feebumper.cpp @@ -239,7 +239,22 @@ Result CreateRateBumpTransaction(CWallet& wallet, const uint256& txid, const CCo bool SignTransaction(CWallet& wallet, CMutableTransaction& mtx) { LOCK(wallet.cs_wallet); - return wallet.SignTransaction(mtx); + + if (wallet.IsWalletFlagSet(WALLET_FLAG_EXTERNAL_SIGNER)) { + // Make a blank psbt + PartiallySignedTransaction psbtx(mtx); + + // First fill transaction with our data without signing, + // so external signers are not asked to sign more than once. + bool complete; + wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, false /* sign */, true /* bip32derivs */); + const TransactionError err = wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, true /* sign */, false /* bip32derivs */); + if (err != TransactionError::OK) return false; + complete = FinalizeAndExtractPSBT(psbtx, mtx); + return complete; + } else { + return wallet.SignTransaction(mtx); + } } Result CommitTransaction(CWallet& wallet, const uint256& txid, CMutableTransaction&& mtx, std::vector<bilingual_str>& errors, uint256& bumped_txid) |