Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show All 13 Lines | |||||
#include <script/standard.h> | #include <script/standard.h> | ||||
#include <support/allocators/secure.h> | #include <support/allocators/secure.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <ui_interface.h> | #include <ui_interface.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <wallet/fees.h> | #include <wallet/fees.h> | ||||
#include <wallet/ismine.h> | #include <wallet/ismine.h> | ||||
#include <wallet/load.h> | #include <wallet/load.h> | ||||
#include <wallet/psbtwallet.h> | |||||
#include <wallet/rpcdump.h> | #include <wallet/rpcdump.h> | ||||
#include <wallet/rpcwallet.h> | |||||
#include <wallet/wallet.h> | #include <wallet/wallet.h> | ||||
namespace interfaces { | namespace interfaces { | ||||
namespace { | namespace { | ||||
//! Construct wallet tx struct. | //! Construct wallet tx struct. | ||||
static WalletTx MakeWalletTx(CWallet &wallet, const CWalletTx &wtx) { | static WalletTx MakeWalletTx(CWallet &wallet, const CWalletTx &wtx) { | ||||
WalletTx result; | WalletTx result; | ||||
▲ Show 20 Lines • Show All 293 Lines • ▼ Show 20 Lines | public: | ||||
num_blocks = locked_chain->getHeight().value_or(-1); | num_blocks = locked_chain->getHeight().value_or(-1); | ||||
in_mempool = mi->second.InMempool(); | in_mempool = mi->second.InMempool(); | ||||
order_form = mi->second.vOrderForm; | order_form = mi->second.vOrderForm; | ||||
tx_status = MakeWalletTxStatus(*locked_chain, mi->second); | tx_status = MakeWalletTxStatus(*locked_chain, mi->second); | ||||
return MakeWalletTx(*m_wallet, mi->second); | return MakeWalletTx(*m_wallet, mi->second); | ||||
} | } | ||||
return {}; | return {}; | ||||
} | } | ||||
TransactionError | |||||
fillPSBT(PartiallySignedTransaction &psbtx, bool &complete, | |||||
SigHashType sighash_type = | |||||
SigHashType().withForkId() /* SIGHASH_ALL|FORKID */, | |||||
bool sign = true, bool bip32derivs = false) override { | |||||
return FillPSBT(m_wallet.get(), psbtx, complete, sighash_type, sign, | |||||
bip32derivs); | |||||
} | |||||
WalletBalances getBalances() override { | WalletBalances getBalances() override { | ||||
const auto bal = m_wallet->GetBalance(); | const auto bal = m_wallet->GetBalance(); | ||||
WalletBalances result; | WalletBalances result; | ||||
result.balance = bal.m_mine_trusted; | result.balance = bal.m_mine_trusted; | ||||
result.unconfirmed_balance = bal.m_mine_untrusted_pending; | result.unconfirmed_balance = bal.m_mine_untrusted_pending; | ||||
result.immature_balance = bal.m_mine_immature; | result.immature_balance = bal.m_mine_immature; | ||||
result.have_watch_only = haveWatchOnly(); | result.have_watch_only = haveWatchOnly(); | ||||
if (result.have_watch_only) { | if (result.have_watch_only) { | ||||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |