Dash Core  0.12.2.1
P2P Digital Currency
CPrivateSendServer Class Reference

#include <privatesend-server.h>

+ Inheritance diagram for CPrivateSendServer:

Public Member Functions

 CPrivateSendServer ()
 
void ProcessMessage (CNode *pfrom, std::string &strCommand, CDataStream &vRecv, CConnman &connman)
 
void CheckTimeout (CConnman &connman)
 
void CheckForCompleteQueue (CConnman &connman)
 
- Public Member Functions inherited from CPrivateSendBase
 CPrivateSendBase ()
 
int GetQueueSize () const
 
int GetState () const
 
std::string GetStateString () const
 
int GetEntriesCount () const
 

Private Member Functions

bool AddEntry (const CDarkSendEntry &entryNew, PoolMessage &nMessageIDRet)
 Add a clients entry to the pool. More...
 
bool AddScriptSig (const CTxIn &txin)
 Add signature to a txin. More...
 
void ChargeFees (CConnman &connman)
 Charge fees to bad actors (Charge clients a fee if they're abusive) More...
 
void ChargeRandomFees (CConnman &connman)
 Rarely charge fees to pay miners. More...
 
void CheckPool (CConnman &connman)
 Check for process. More...
 
void CreateFinalTransaction (CConnman &connman)
 
void CommitFinalTransaction (CConnman &connman)
 
bool IsAcceptableDenomAndCollateral (int nDenom, CTransaction txCollateral, PoolMessage &nMessageIDRet)
 Is this nDenom and txCollateral acceptable? More...
 
bool CreateNewSession (int nDenom, CTransaction txCollateral, PoolMessage &nMessageIDRet, CConnman &connman)
 
bool AddUserToExistingSession (int nDenom, CTransaction txCollateral, PoolMessage &nMessageIDRet)
 
bool IsSessionReady ()
 Do we have enough users to take entries? More...
 
bool IsSignaturesComplete ()
 Check that all inputs are signed. (Are all inputs signed?) More...
 
bool IsInputScriptSigValid (const CTxIn &txin)
 Check to make sure a given input matches an input in the pool and its scriptSig is valid. More...
 
bool IsOutputsCompatibleWithSessionDenom (const std::vector< CTxDSOut > &vecTxDSOut)
 Are these outputs compatible with other client in the pool? More...
 
void SetState (PoolState nStateNew)
 
void RelayFinalTransaction (const CTransaction &txFinal, CConnman &connman)
 Relay mixing Messages. More...
 
void PushStatus (CNode *pnode, PoolStatusUpdate nStatusUpdate, PoolMessage nMessageID, CConnman &connman)
 
void RelayStatus (PoolStatusUpdate nStatusUpdate, CConnman &connman, PoolMessage nMessageID=MSG_NOERR)
 
void RelayCompletedTransaction (PoolMessage nMessageID, CConnman &connman)
 
void SetNull ()
 

Private Attributes

CCriticalSection cs_darksend
 
std::vector< CTransactionvecSessionCollaterals
 
bool fUnitTest
 

Additional Inherited Members

- Public Attributes inherited from CPrivateSendBase
int nSessionDenom
 
- Protected Member Functions inherited from CPrivateSendBase
void SetNull ()
 
- Protected Attributes inherited from CPrivateSendBase
std::vector< CDarksendQueuevecDarksendQueue
 
std::vector< CDarkSendEntryvecEntries
 
PoolState nState
 
int64_t nTimeLastSuccessfulStep
 
int nSessionID
 
CMutableTransaction finalMutableTransaction
 

Detailed Description

Used to keep track of current status of mixing pool

Definition at line 18 of file privatesend-server.h.

Constructor & Destructor Documentation

◆ CPrivateSendServer()

CPrivateSendServer::CPrivateSendServer ( )
inline

Definition at line 71 of file privatesend-server.h.

Member Function Documentation

◆ AddEntry()

bool CPrivateSendServer::AddEntry ( const CDarkSendEntry entryNew,
PoolMessage nMessageIDRet 
)
private

Add a clients entry to the pool.

Definition at line 591 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ AddScriptSig()

bool CPrivateSendServer::AddScriptSig ( const CTxIn txin)
private

Add signature to a txin.

Definition at line 637 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ AddUserToExistingSession()

bool CPrivateSendServer::AddUserToExistingSession ( int  nDenom,
CTransaction  txCollateral,
PoolMessage nMessageIDRet 
)
private

Definition at line 759 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ ChargeFees()

void CPrivateSendServer::ChargeFees ( CConnman connman)
private

Charge fees to bad actors (Charge clients a fee if they're abusive)

Definition at line 392 of file privatesend-server.cpp.

Referenced by CheckTimeout().

◆ ChargeRandomFees()

void CPrivateSendServer::ChargeRandomFees ( CConnman connman)
private

Rarely charge fees to pay miners.

Definition at line 469 of file privatesend-server.cpp.

Referenced by CommitFinalTransaction().

◆ CheckForCompleteQueue()

void CPrivateSendServer::CheckForCompleteQueue ( CConnman connman)

Definition at line 531 of file privatesend-server.cpp.

Referenced by ThreadCheckPrivateSendServer().

◆ CheckPool()

void CPrivateSendServer::CheckPool ( CConnman connman)
private

Check for process.

Definition at line 278 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ CheckTimeout()

void CPrivateSendServer::CheckTimeout ( CConnman connman)

Definition at line 495 of file privatesend-server.cpp.

Referenced by ThreadCheckPrivateSendServer().

◆ CommitFinalTransaction()

void CPrivateSendServer::CommitFinalTransaction ( CConnman connman)
private

Definition at line 331 of file privatesend-server.cpp.

Referenced by CheckPool().

◆ CreateFinalTransaction()

void CPrivateSendServer::CreateFinalTransaction ( CConnman connman)
private

Definition at line 305 of file privatesend-server.cpp.

Referenced by CheckPool().

◆ CreateNewSession()

bool CPrivateSendServer::CreateNewSession ( int  nDenom,
CTransaction  txCollateral,
PoolMessage nMessageIDRet,
CConnman connman 
)
private

Definition at line 720 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ IsAcceptableDenomAndCollateral()

bool CPrivateSendServer::IsAcceptableDenomAndCollateral ( int  nDenom,
CTransaction  txCollateral,
PoolMessage nMessageIDRet 
)
private

Is this nDenom and txCollateral acceptable?

Definition at line 698 of file privatesend-server.cpp.

Referenced by AddUserToExistingSession(), and CreateNewSession().

◆ IsInputScriptSigValid()

bool CPrivateSendServer::IsInputScriptSigValid ( const CTxIn txin)
private

Check to make sure a given input matches an input in the pool and its scriptSig is valid.

Definition at line 546 of file privatesend-server.cpp.

Referenced by AddScriptSig().

◆ IsOutputsCompatibleWithSessionDenom()

bool CPrivateSendServer::IsOutputsCompatibleWithSessionDenom ( const std::vector< CTxDSOut > &  vecTxDSOut)
private

Are these outputs compatible with other client in the pool?

Definition at line 685 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ IsSessionReady()

bool CPrivateSendServer::IsSessionReady ( )
inlineprivate

Do we have enough users to take entries?

Definition at line 50 of file privatesend-server.h.

Referenced by AddUserToExistingSession(), CheckForCompleteQueue(), and ProcessMessage().

◆ IsSignaturesComplete()

bool CPrivateSendServer::IsSignaturesComplete ( )
private

Check that all inputs are signed. (Are all inputs signed?)

Definition at line 676 of file privatesend-server.cpp.

Referenced by CheckPool().

◆ ProcessMessage()

void CPrivateSendServer::ProcessMessage ( CNode pfrom,
std::string &  strCommand,
CDataStream vRecv,
CConnman connman 
)

Definition at line 18 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ PushStatus()

void CPrivateSendServer::PushStatus ( CNode pnode,
PoolStatusUpdate  nStatusUpdate,
PoolMessage  nMessageID,
CConnman connman 
)
private

Definition at line 812 of file privatesend-server.cpp.

Referenced by ProcessMessage().

◆ RelayCompletedTransaction()

void CPrivateSendServer::RelayCompletedTransaction ( PoolMessage  nMessageID,
CConnman connman 
)
private

Definition at line 854 of file privatesend-server.cpp.

Referenced by CommitFinalTransaction().

◆ RelayFinalTransaction()

void CPrivateSendServer::RelayFinalTransaction ( const CTransaction txFinal,
CConnman connman 
)
private

Relay mixing Messages.

Definition at line 793 of file privatesend-server.cpp.

Referenced by CreateFinalTransaction().

◆ RelayStatus()

void CPrivateSendServer::RelayStatus ( PoolStatusUpdate  nStatusUpdate,
CConnman connman,
PoolMessage  nMessageID = MSG_NOERR 
)
private

◆ SetNull()

void CPrivateSendServer::SetNull ( )
private

◆ SetState()

void CPrivateSendServer::SetState ( PoolState  nStateNew)
private

Member Data Documentation

◆ cs_darksend

CCriticalSection CPrivateSendServer::cs_darksend
mutableprivate

Definition at line 21 of file privatesend-server.h.

Referenced by CheckTimeout(), and ProcessMessage().

◆ fUnitTest

bool CPrivateSendServer::fUnitTest
private

Definition at line 27 of file privatesend-server.h.

Referenced by CreateNewSession(), and IsAcceptableDenomAndCollateral().

◆ vecSessionCollaterals

std::vector<CTransaction> CPrivateSendServer::vecSessionCollaterals
private

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