Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | namespace { | ||||
class PendingWalletTxImpl : public PendingWalletTx { | class PendingWalletTxImpl : public PendingWalletTx { | ||||
public: | public: | ||||
PendingWalletTxImpl(CWallet &wallet) | PendingWalletTxImpl(CWallet &wallet) | ||||
: m_wallet(wallet), m_key(&wallet) {} | : m_wallet(wallet), m_key(&wallet) {} | ||||
const CTransaction &get() override { return *m_tx; } | const CTransaction &get() override { return *m_tx; } | ||||
bool commit(WalletValueMap value_map, WalletOrderForm order_form, | bool commit(WalletValueMap value_map, WalletOrderForm order_form, | ||||
std::string from_account, | |||||
std::string &reject_reason) override { | std::string &reject_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); | ||||
CValidationState state; | CValidationState state; | ||||
if (!m_wallet.CommitTransaction( | if (!m_wallet.CommitTransaction(m_tx, std::move(value_map), | ||||
m_tx, std::move(value_map), std::move(order_form), | std::move(order_form), m_key, | ||||
std::move(from_account), m_key, g_connman.get(), state)) { | g_connman.get(), state)) { | ||||
reject_reason = state.GetRejectReason(); | reject_reason = state.GetRejectReason(); | ||||
return false; | return false; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
CTransactionRef m_tx; | CTransactionRef m_tx; | ||||
CWallet &m_wallet; | CWallet &m_wallet; | ||||
▲ Show 20 Lines • Show All 463 Lines • Show Last 20 Lines |