mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Merge #16944: gui: create PSBT with watch-only wallet
c6dd565c88[gui] watch-only wallet: copy PSBT to clipboard (Sjors Provoost)39465d545d[wallet] add fillPSBT to interface (Sjors Provoost)848f889208[gui] send: include watch-only (Sjors Provoost)40537f0909[wallet] ListCoins: include watch-only for wallets without private keys (Sjors Provoost) Pull request description: For wallets with `WALLET_FLAG_DISABLE_PRIVATE_KEYS` this makes the watch-only balance available on the send screen (including coin selection). Instead of sending a transaction it generates a PSBT. The user can take this PSBT and process it with [HWI](https://github.com/bitcoin-core/HWI) or put it an SD card for hardware wallets that support that. The PSBT is copied to the clipboard. This was the easiest approach; we can add a dialog later to display it, as well as an option to save to disk. ACKs for top commit: instagibbs: test and code review ACK https://github.com/bitcoin/bitcoin/pull/16944/commits/c6dd565c8820aa8a98b190621e10c6e2821a9ecc meshcollider: re-ACKc6dd565c88Tree-SHA512: ebc3da0737e33b255ed926191b84569aedb6097d14868662bd5dce726ce3048e86e9a31eba987b10dffe1482b35c21ae1cd595c2caa4634bc4cf78a826a83852
This commit is contained in:
commit
0aa72061e5
6 changed files with 85 additions and 23 deletions
|
|
@ -18,8 +18,9 @@
|
|||
#include <wallet/feebumper.h>
|
||||
#include <wallet/fees.h>
|
||||
#include <wallet/ismine.h>
|
||||
#include <wallet/rpcwallet.h>
|
||||
#include <wallet/load.h>
|
||||
#include <wallet/psbtwallet.h>
|
||||
#include <wallet/rpcwallet.h>
|
||||
#include <wallet/wallet.h>
|
||||
|
||||
#include <memory>
|
||||
|
|
@ -357,6 +358,14 @@ public:
|
|||
}
|
||||
return {};
|
||||
}
|
||||
TransactionError fillPSBT(PartiallySignedTransaction& psbtx,
|
||||
bool& complete,
|
||||
int sighash_type = 1 /* SIGHASH_ALL */,
|
||||
bool sign = true,
|
||||
bool bip32derivs = false) override
|
||||
{
|
||||
return FillPSBT(m_wallet.get(), psbtx, complete, sighash_type, sign, bip32derivs);
|
||||
}
|
||||
WalletBalances getBalances() override
|
||||
{
|
||||
const auto bal = m_wallet->GetBalance();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue