Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | public: | ||||
CTransactionRef | CTransactionRef | ||||
createTransaction(const std::vector<CRecipient> &recipients, | createTransaction(const std::vector<CRecipient> &recipients, | ||||
const CCoinControl &coin_control, bool sign, | const CCoinControl &coin_control, bool sign, | ||||
int &change_pos, Amount &fee, | int &change_pos, Amount &fee, | ||||
bilingual_str &fail_reason) override { | bilingual_str &fail_reason) override { | ||||
auto locked_chain = m_wallet->chain().lock(); | auto locked_chain = m_wallet->chain().lock(); | ||||
LOCK(m_wallet->cs_wallet); | LOCK(m_wallet->cs_wallet); | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
if (!m_wallet->CreateTransaction(*locked_chain, recipients, tx, fee, | if (!m_wallet->CreateTransaction(recipients, tx, fee, change_pos, | ||||
change_pos, fail_reason, | fail_reason, coin_control, sign)) { | ||||
coin_control, sign)) { | |||||
return {}; | return {}; | ||||
} | } | ||||
return tx; | return tx; | ||||
} | } | ||||
void commitTransaction(CTransactionRef tx, WalletValueMap value_map, | void commitTransaction(CTransactionRef tx, WalletValueMap value_map, | ||||
WalletOrderForm order_form) override { | WalletOrderForm order_form) override { | ||||
auto locked_chain = m_wallet->chain().lock(); | auto locked_chain = m_wallet->chain().lock(); | ||||
LOCK(m_wallet->cs_wallet); | LOCK(m_wallet->cs_wallet); | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | public: | ||||
WalletTx getWalletTxDetails(const TxId &txid, WalletTxStatus &tx_status, | WalletTx getWalletTxDetails(const TxId &txid, WalletTxStatus &tx_status, | ||||
WalletOrderForm &order_form, | WalletOrderForm &order_form, | ||||
bool &in_mempool, | bool &in_mempool, | ||||
int &num_blocks) override { | int &num_blocks) override { | ||||
auto locked_chain = m_wallet->chain().lock(); | auto locked_chain = m_wallet->chain().lock(); | ||||
LOCK(m_wallet->cs_wallet); | LOCK(m_wallet->cs_wallet); | ||||
auto mi = m_wallet->mapWallet.find(txid); | auto mi = m_wallet->mapWallet.find(txid); | ||||
if (mi != m_wallet->mapWallet.end()) { | if (mi != m_wallet->mapWallet.end()) { | ||||
num_blocks = locked_chain->getHeight().value_or(-1); | num_blocks = m_wallet->GetLastBlockHeight(); | ||||
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 | TransactionError | ||||
▲ Show 20 Lines • Show All 200 Lines • Show Last 20 Lines |