Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 261 Lines • ▼ Show 20 Lines | public: | ||||
result.reserve(m_wallet.mapWallet.size()); | result.reserve(m_wallet.mapWallet.size()); | ||||
for (const auto &entry : m_wallet.mapWallet) { | for (const auto &entry : m_wallet.mapWallet) { | ||||
result.emplace_back(MakeWalletTx(m_wallet, entry.second)); | result.emplace_back(MakeWalletTx(m_wallet, entry.second)); | ||||
} | } | ||||
return result; | return result; | ||||
} | } | ||||
bool tryGetTxStatus(const TxId &txid, | bool tryGetTxStatus(const TxId &txid, | ||||
interfaces::WalletTxStatus &tx_status, | interfaces::WalletTxStatus &tx_status, | ||||
int &num_blocks) override { | int &num_blocks, int64_t &block_time) override { | ||||
TRY_LOCK(::cs_main, locked_chain); | TRY_LOCK(::cs_main, locked_chain); | ||||
if (!locked_chain) { | if (!locked_chain) { | ||||
return false; | return false; | ||||
} | } | ||||
TRY_LOCK(m_wallet.cs_wallet, locked_wallet); | TRY_LOCK(m_wallet.cs_wallet, locked_wallet); | ||||
if (!locked_wallet) { | if (!locked_wallet) { | ||||
return false; | return false; | ||||
} | } | ||||
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()) { | ||||
return false; | return false; | ||||
} | } | ||||
num_blocks = ::chainActive.Height(); | num_blocks = ::chainActive.Height(); | ||||
block_time = ::chainActive.Tip()->GetBlockTime(); | |||||
tx_status = MakeWalletTxStatus(mi->second); | tx_status = MakeWalletTxStatus(mi->second); | ||||
return true; | return true; | ||||
} | } | ||||
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 { | ||||
LOCK2(::cs_main, m_wallet.cs_wallet); | LOCK2(::cs_main, m_wallet.cs_wallet); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |