Skip to content

Commit 39465d5

Browse files
committed
[wallet] add fillPSBT to interface
1 parent 848f889 commit 39465d5

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/interfaces/wallet.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
#include <wallet/feebumper.h>
1919
#include <wallet/fees.h>
2020
#include <wallet/ismine.h>
21-
#include <wallet/rpcwallet.h>
2221
#include <wallet/load.h>
22+
#include <wallet/psbtwallet.h>
23+
#include <wallet/rpcwallet.h>
2324
#include <wallet/wallet.h>
2425

2526
#include <memory>
@@ -343,6 +344,14 @@ class WalletImpl : public Wallet
343344
}
344345
return {};
345346
}
347+
TransactionError fillPSBT(PartiallySignedTransaction& psbtx,
348+
bool& complete,
349+
int sighash_type = 1 /* SIGHASH_ALL */,
350+
bool sign = true,
351+
bool bip32derivs = false) override
352+
{
353+
return FillPSBT(m_wallet.get(), psbtx, complete, sighash_type, sign, bip32derivs);
354+
}
346355
WalletBalances getBalances() override
347356
{
348357
const auto bal = m_wallet->GetBalance();

src/interfaces/wallet.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <functional>
1515
#include <map>
1616
#include <memory>
17+
#include <psbt.h>
1718
#include <stdint.h>
1819
#include <string>
1920
#include <tuple>
@@ -194,6 +195,13 @@ class Wallet
194195
bool& in_mempool,
195196
int& num_blocks) = 0;
196197

198+
//! Fill PSBT.
199+
virtual TransactionError fillPSBT(PartiallySignedTransaction& psbtx,
200+
bool& complete,
201+
int sighash_type = 1 /* SIGHASH_ALL */,
202+
bool sign = true,
203+
bool bip32derivs = false) = 0;
204+
197205
//! Get balances.
198206
virtual WalletBalances getBalances() = 0;
199207

0 commit comments

Comments
 (0)