Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Protected Attributes | Private Types | Private Attributes | List of all members
dev::eth::AccountHolder Class Referenceabstract

Manages real accounts (where we know the secret key) and proxy accounts (where transactions to be sent from these accounts are forwarded to a proxy on the other side). More...

#include <AccountHolder.h>

Inheritance diagram for dev::eth::AccountHolder:
[legend]

Public Member Functions

 AccountHolder (std::function< Interface *()> const &_client)
 
virtual AddressHash realAccounts () const =0
 
virtual TransactionNotification authenticate (dev::eth::TransactionSkeleton const &_t)=0
 
Addresses allAccounts () const
 
bool isRealAccount (Address const &_account) const
 
bool isProxyAccount (Address const &_account) const
 
Address const & defaultTransactAccount () const
 
virtual bool unlockAccount (Address const &, std::string const &, unsigned)
 Automatically authenticate all transactions for the given account for the next _duration seconds. More...
 
int addProxyAccount (Address const &_account)
 
bool removeProxyAccount (unsigned _id)
 
void queueTransaction (eth::TransactionSkeleton const &_transaction)
 
std::vector< eth::TransactionSkeleton > const & queuedTransactions (int _id) const
 
void clearQueue (int _id)
 

Protected Attributes

std::function< Interface *()> m_client
 

Private Types

using TransactionQueue = std::vector< eth::TransactionSkeleton >
 

Private Attributes

std::unordered_map< Address, int > m_proxyAccounts
 
std::unordered_map< int, std::pair< Address, TransactionQueue > > m_transactionQueues
 

Detailed Description

Manages real accounts (where we know the secret key) and proxy accounts (where transactions to be sent from these accounts are forwarded to a proxy on the other side).

Definition at line 64 of file AccountHolder.h.

Member Typedef Documentation

Definition at line 102 of file AccountHolder.h.

Constructor & Destructor Documentation

dev::eth::AccountHolder::AccountHolder ( std::function< Interface *()> const &  _client)
inlineexplicit

Definition at line 67 of file AccountHolder.h.

Member Function Documentation

int AccountHolder::addProxyAccount ( Address const &  _account)

Definition at line 61 of file AccountHolder.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

vector< Address > AccountHolder::allAccounts ( ) const

Definition at line 39 of file AccountHolder.cpp.

Here is the caller graph for this function:

virtual TransactionNotification dev::eth::AccountHolder::authenticate ( dev::eth::TransactionSkeleton const &  _t)
pure virtual

Implemented in dev::eth::FixedAccountHolder, and dev::eth::SimpleAccountHolder.

Here is the caller graph for this function:

void AccountHolder::clearQueue ( int  _id)

Definition at line 97 of file AccountHolder.cpp.

Here is the caller graph for this function:

Address const & AccountHolder::defaultTransactAccount ( ) const

Definition at line 49 of file AccountHolder.cpp.

Here is the caller graph for this function:

bool dev::eth::AccountHolder::isProxyAccount ( Address const &  _account) const
inline

Definition at line 76 of file AccountHolder.h.

bool dev::eth::AccountHolder::isRealAccount ( Address const &  _account) const
inline

Definition at line 75 of file AccountHolder.h.

vector< TransactionSkeleton > const & AccountHolder::queuedTransactions ( int  _id) const

Definition at line 90 of file AccountHolder.cpp.

Here is the caller graph for this function:

void AccountHolder::queueTransaction ( eth::TransactionSkeleton const &  _transaction)

Definition at line 82 of file AccountHolder.cpp.

Here is the caller graph for this function:

virtual AddressHash dev::eth::AccountHolder::realAccounts ( ) const
pure virtual
bool AccountHolder::removeProxyAccount ( unsigned  _id)

Definition at line 73 of file AccountHolder.cpp.

Here is the caller graph for this function:

virtual bool dev::eth::AccountHolder::unlockAccount ( Address const &  ,
std::string const &  ,
unsigned   
)
inlinevirtual

Automatically authenticate all transactions for the given account for the next _duration seconds.

Decrypt the key with _password if needed.

Returns
true on success. Only works for direct accounts.

Reimplemented in dev::eth::SimpleAccountHolder.

Definition at line 82 of file AccountHolder.h.

Here is the caller graph for this function:

Member Data Documentation

std::function<Interface*()> dev::eth::AccountHolder::m_client
protected

Definition at line 99 of file AccountHolder.h.

std::unordered_map<Address, int> dev::eth::AccountHolder::m_proxyAccounts
private

Definition at line 104 of file AccountHolder.h.

std::unordered_map<int, std::pair<Address, TransactionQueue> > dev::eth::AccountHolder::m_transactionQueues
private

Definition at line 105 of file AccountHolder.h.


The documentation for this class was generated from the following files: