Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/wallet.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | namespace { | ||||
//! Construct wallet TxOut struct. | //! Construct wallet TxOut struct. | ||||
WalletTxOut MakeWalletTxOut(CWallet &wallet, const CWalletTx &wtx, int n, | WalletTxOut MakeWalletTxOut(CWallet &wallet, const CWalletTx &wtx, int n, | ||||
int depth) { | int depth) { | ||||
WalletTxOut result; | WalletTxOut result; | ||||
result.txout = wtx.tx->vout[n]; | result.txout = wtx.tx->vout[n]; | ||||
result.time = wtx.GetTxTime(); | result.time = wtx.GetTxTime(); | ||||
result.depth_in_main_chain = depth; | result.depth_in_main_chain = depth; | ||||
result.is_spent = wallet.IsSpent(wtx.GetId(), n); | result.is_spent = wallet.IsSpent(COutPoint(wtx.GetId(), n)); | ||||
return result; | return result; | ||||
} | } | ||||
class WalletImpl : public Wallet { | class WalletImpl : public Wallet { | ||||
public: | public: | ||||
WalletImpl(CWallet &wallet) : m_wallet(wallet) {} | WalletImpl(CWallet &wallet) : m_wallet(wallet) {} | ||||
bool encryptWallet(const SecureString &wallet_passphrase) override { | bool encryptWallet(const SecureString &wallet_passphrase) override { | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | public: | ||||
return m_wallet.LockCoin(output); | return m_wallet.LockCoin(output); | ||||
} | } | ||||
void unlockCoin(const COutPoint &output) override { | void unlockCoin(const COutPoint &output) override { | ||||
LOCK2(cs_main, m_wallet.cs_wallet); | LOCK2(cs_main, m_wallet.cs_wallet); | ||||
return m_wallet.UnlockCoin(output); | return m_wallet.UnlockCoin(output); | ||||
} | } | ||||
bool isLockedCoin(const COutPoint &output) override { | bool isLockedCoin(const COutPoint &output) override { | ||||
LOCK2(cs_main, m_wallet.cs_wallet); | LOCK2(cs_main, m_wallet.cs_wallet); | ||||
return m_wallet.IsLockedCoin(output.GetTxId(), output.GetN()); | return m_wallet.IsLockedCoin(output); | ||||
} | } | ||||
void listLockedCoins(std::vector<COutPoint> &outputs) override { | void listLockedCoins(std::vector<COutPoint> &outputs) override { | ||||
LOCK2(cs_main, m_wallet.cs_wallet); | LOCK2(cs_main, m_wallet.cs_wallet); | ||||
return m_wallet.ListLockedCoins(outputs); | return m_wallet.ListLockedCoins(outputs); | ||||
} | } | ||||
std::unique_ptr<PendingWalletTx> | std::unique_ptr<PendingWalletTx> | ||||
createTransaction(const std::vector<CRecipient> &recipients, | createTransaction(const std::vector<CRecipient> &recipients, | ||||
const CCoinControl &coin_control, bool sign, | const CCoinControl &coin_control, bool sign, | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |