mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Merge bitcoin/bitcoin#21576: rpc, gui: bumpfee signer support
2c07cfacd1gui: bumpfee signer support (Sjors Provoost)7e02a33297rpc: bumpfee signer support (Sjors Provoost)304ece9945rpc: document bools in FillPSBT() calls (Sjors Provoost) Pull request description: The `bumpfee` RPC call and GUI fee bump interface now work with an external signer. ACKs for top commit: achow101: ACK2c07cfacd1furszy: code review ACK2c07cfacjarolrod: tACK2c07cfaTree-SHA512: 0c7b931f76fac67c9e33b9b935f29af6f69ac67a5ffcc586ed2f1676feac427735b1d971723b29ef332bb6fb5762949598ebbf728587e8f0ded95a9bfbb3e7a4
This commit is contained in:
@@ -293,7 +293,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)
|
||||
|
||||
Reference in New Issue
Block a user