PIVX Core  5.6.99
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
CBudgetProposal Class Reference

#include <budgetproposal.h>

Collaboration diagram for CBudgetProposal:
[legend]

Public Member Functions

 CBudgetProposal ()
 
 CBudgetProposal (const std::string &name, const std::string &url, int paycount, const CScript &payee, const CAmount &amount, int blockstart, const uint256 &nfeetxhash)
 
bool AddOrUpdateVote (const CBudgetVote &vote, std::string &strError)
 
UniValue GetVotesArray () const
 
void SetSynced (bool synced)
 
void SyncVotes (CNode *pfrom, bool fPartial, int &nInvCount) const
 
bool UpdateValid (int nHeight, int mnCount)
 
bool IsWellFormed (const CAmount &nTotalBudget)
 
bool IsValid () const
 
void SetStrInvalid (const std::string &_strInvalid)
 
std::string IsInvalidReason () const
 
std::string IsInvalidLogStr () const
 
bool IsEstablished () const
 
bool IsPassing (int nBlockStartBudget, int nBlockEndBudget, int mnCount) const
 
bool IsExpired (int nCurrentHeight) const
 
std::string GetName () const
 
std::string GetURL () const
 
int GetBlockStart () const
 
int GetBlockEnd () const
 
CScript GetPayee () const
 
int GetTotalPaymentCount () const
 
int GetRemainingPaymentCount (int nCurrentHeight) const
 
int GetBlockStartCycle () const
 
int GetBlockEndCycle () const
 
const uint256GetFeeTXHash () const
 
double GetRatio () const
 
int GetVoteCount (CBudgetVote::VoteDirection vd) const
 
std::map< COutPoint, CBudgetVoteGetVotes () const
 
int GetYeas () const
 
int GetNays () const
 
int GetAbstains () const
 
CAmount GetAmount () const
 
void SetAllotted (CAmount nAllottedIn)
 
CAmount GetAllotted () const
 
void SetFeeTxHash (const uint256 &txid)
 
uint256 GetHash () const
 
 SERIALIZE_METHODS (CBudgetProposal, obj)
 
bool ParseBroadcast (CDataStream &broadcast)
 
CDataStream GetBroadcast () const
 
void Relay ()
 
bool operator== (const CBudgetProposal &other) const
 
bool operator> (const CBudgetProposal &other) const
 

Static Public Member Functions

static int GetBlockCycle (int nCurrentHeight)
 
static bool PtrHigherYes (CBudgetProposal *a, CBudgetProposal *b)
 

Public Attributes

int64_t nTime
 

Protected Attributes

std::map< COutPoint, CBudgetVotemapVotes
 
std::string strProposalName
 
std::string strURL
 
int nBlockStart
 
int nBlockEnd
 
CScript address
 
CAmount nAmount
 
uint256 nFeeTXHash
 

Private Member Functions

bool IsHeavilyDownvoted (int mnCount)
 
bool updateExpired (int nCurrentHeight)
 
bool CheckStartEnd ()
 
bool CheckAmount (const CAmount &nTotalBudget)
 
bool CheckAddress ()
 
bool CheckStrings ()
 

Private Attributes

CAmount nAllotted
 
bool fValid
 
std::string strInvalid
 

Friends

class CBudgetManager
 

Detailed Description

Definition at line 31 of file budgetproposal.h.

Constructor & Destructor Documentation

◆ CBudgetProposal() [1/2]

CBudgetProposal::CBudgetProposal ( )

Definition at line 11 of file budgetproposal.cpp.

Here is the caller graph for this function:

◆ CBudgetProposal() [2/2]

CBudgetProposal::CBudgetProposal ( const std::string &  name,
const std::string &  url,
int  paycount,
const CScript payee,
const CAmount amount,
int  blockstart,
const uint256 nfeetxhash 
)

Definition at line 25 of file budgetproposal.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ AddOrUpdateVote()

bool CBudgetProposal::AddOrUpdateVote ( const CBudgetVote vote,
std::string &  strError 
)

Definition at line 225 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckAddress()

bool CBudgetProposal::CheckAddress ( )
private
Todo:
: There might be an issue with multisig in the coinbase on mainnet

Definition at line 126 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckAmount()

bool CBudgetProposal::CheckAmount ( const CAmount nTotalBudget)
private

Definition at line 108 of file budgetproposal.cpp.

Here is the caller graph for this function:

◆ CheckStartEnd()

bool CBudgetProposal::CheckStartEnd ( )
private

Definition at line 86 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CheckStrings()

bool CBudgetProposal::CheckStrings ( )
private

Definition at line 152 of file budgetproposal.cpp.

Here is the call graph for this function:

◆ GetAbstains()

int CBudgetProposal::GetAbstains ( ) const
inline

Definition at line 100 of file budgetproposal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetAllotted()

CAmount CBudgetProposal::GetAllotted ( ) const
inline

Definition at line 103 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetAmount()

CAmount CBudgetProposal::GetAmount ( ) const
inline

Definition at line 101 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetBlockCycle()

int CBudgetProposal::GetBlockCycle ( int  nCurrentHeight)
static

Definition at line 301 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBlockEnd()

int CBudgetProposal::GetBlockEnd ( ) const
inline

Definition at line 87 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetBlockEndCycle()

int CBudgetProposal::GetBlockEndCycle ( ) const

Definition at line 306 of file budgetproposal.cpp.

Here is the caller graph for this function:

◆ GetBlockStart()

int CBudgetProposal::GetBlockStart ( ) const
inline

Definition at line 86 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetBlockStartCycle()

int CBudgetProposal::GetBlockStartCycle ( ) const

Definition at line 295 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBroadcast()

CDataStream CBudgetProposal::GetBroadcast ( ) const

Definition at line 326 of file budgetproposal.cpp.

◆ GetFeeTXHash()

const uint256& CBudgetProposal::GetFeeTXHash ( ) const
inline

Definition at line 94 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetHash()

uint256 CBudgetProposal::GetHash ( ) const
inline

Definition at line 106 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetName()

std::string CBudgetProposal::GetName ( ) const
inline

Definition at line 84 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetNays()

int CBudgetProposal::GetNays ( ) const
inline

Definition at line 99 of file budgetproposal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPayee()

CScript CBudgetProposal::GetPayee ( ) const
inline

Definition at line 88 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetRatio()

double CBudgetProposal::GetRatio ( ) const

Definition at line 274 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetRemainingPaymentCount()

int CBudgetProposal::GetRemainingPaymentCount ( int  nCurrentHeight) const

Definition at line 317 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTotalPaymentCount()

int CBudgetProposal::GetTotalPaymentCount ( ) const

Definition at line 312 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetURL()

std::string CBudgetProposal::GetURL ( ) const
inline

Definition at line 85 of file budgetproposal.h.

Here is the caller graph for this function:

◆ GetVoteCount()

int CBudgetProposal::GetVoteCount ( CBudgetVote::VoteDirection  vd) const

Definition at line 284 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetVotes()

std::map<COutPoint, CBudgetVote> CBudgetProposal::GetVotes ( ) const
inline

Definition at line 97 of file budgetproposal.h.

◆ GetVotesArray()

UniValue CBudgetProposal::GetVotesArray ( ) const

Definition at line 253 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetYeas()

int CBudgetProposal::GetYeas ( ) const
inline

Definition at line 98 of file budgetproposal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsEstablished()

bool CBudgetProposal::IsEstablished ( ) const

Definition at line 195 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsExpired()

bool CBudgetProposal::IsExpired ( int  nCurrentHeight) const

Definition at line 220 of file budgetproposal.cpp.

Here is the caller graph for this function:

◆ IsHeavilyDownvoted()

bool CBudgetProposal::IsHeavilyDownvoted ( int  mnCount)
private

Definition at line 77 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInvalidLogStr()

std::string CBudgetProposal::IsInvalidLogStr ( ) const
inline

Definition at line 78 of file budgetproposal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsInvalidReason()

std::string CBudgetProposal::IsInvalidReason ( ) const
inline

Definition at line 77 of file budgetproposal.h.

Here is the caller graph for this function:

◆ IsPassing()

bool CBudgetProposal::IsPassing ( int  nBlockStartBudget,
int  nBlockEndBudget,
int  mnCount 
) const

Definition at line 200 of file budgetproposal.cpp.

Here is the call graph for this function:

◆ IsValid()

bool CBudgetProposal::IsValid ( ) const
inline

Definition at line 75 of file budgetproposal.h.

Here is the caller graph for this function:

◆ IsWellFormed()

bool CBudgetProposal::IsWellFormed ( const CAmount nTotalBudget)

Definition at line 163 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

bool CBudgetProposal::operator== ( const CBudgetProposal other) const
inline

Definition at line 137 of file budgetproposal.h.

Here is the call graph for this function:

◆ operator>()

bool CBudgetProposal::operator> ( const CBudgetProposal other) const
inline

Definition at line 143 of file budgetproposal.h.

Here is the call graph for this function:

◆ ParseBroadcast()

bool CBudgetProposal::ParseBroadcast ( CDataStream broadcast)

Definition at line 48 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PtrHigherYes()

static bool CBudgetProposal::PtrHigherYes ( CBudgetProposal a,
CBudgetProposal b 
)
inlinestatic

Definition at line 149 of file budgetproposal.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Relay()

void CBudgetProposal::Relay ( )

Definition at line 341 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SERIALIZE_METHODS()

CBudgetProposal::SERIALIZE_METHODS ( CBudgetProposal  ,
obj   
)
inline

Definition at line 119 of file budgetproposal.h.

◆ SetAllotted()

void CBudgetProposal::SetAllotted ( CAmount  nAllottedIn)
inline

Definition at line 102 of file budgetproposal.h.

◆ SetFeeTxHash()

void CBudgetProposal::SetFeeTxHash ( const uint256 txid)
inline

Definition at line 104 of file budgetproposal.h.

◆ SetStrInvalid()

void CBudgetProposal::SetStrInvalid ( const std::string &  _strInvalid)
inline

Definition at line 76 of file budgetproposal.h.

Here is the caller graph for this function:

◆ SetSynced()

void CBudgetProposal::SetSynced ( bool  synced)

Definition at line 262 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SyncVotes()

void CBudgetProposal::SyncVotes ( CNode pfrom,
bool  fPartial,
int &  nInvCount 
) const

Definition at line 66 of file budgetproposal.cpp.

Here is the call graph for this function:

◆ updateExpired()

bool CBudgetProposal::updateExpired ( int  nCurrentHeight)
private

Definition at line 168 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateValid()

bool CBudgetProposal::UpdateValid ( int  nHeight,
int  mnCount 
)

Definition at line 177 of file budgetproposal.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ CBudgetManager

friend class CBudgetManager
friend

Definition at line 34 of file budgetproposal.h.

Member Data Documentation

◆ address

CScript CBudgetProposal::address
protected

Definition at line 53 of file budgetproposal.h.

◆ fValid

bool CBudgetProposal::fValid
private

Definition at line 36 of file budgetproposal.h.

◆ mapVotes

std::map<COutPoint, CBudgetVote> CBudgetProposal::mapVotes
protected

Definition at line 48 of file budgetproposal.h.

◆ nAllotted

CAmount CBudgetProposal::nAllotted
private

Definition at line 35 of file budgetproposal.h.

◆ nAmount

CAmount CBudgetProposal::nAmount
protected

Definition at line 54 of file budgetproposal.h.

◆ nBlockEnd

int CBudgetProposal::nBlockEnd
protected

Definition at line 52 of file budgetproposal.h.

◆ nBlockStart

int CBudgetProposal::nBlockStart
protected

Definition at line 51 of file budgetproposal.h.

◆ nFeeTXHash

uint256 CBudgetProposal::nFeeTXHash
protected

Definition at line 55 of file budgetproposal.h.

◆ nTime

int64_t CBudgetProposal::nTime

Definition at line 59 of file budgetproposal.h.

◆ strInvalid

std::string CBudgetProposal::strInvalid
private

Definition at line 37 of file budgetproposal.h.

◆ strProposalName

std::string CBudgetProposal::strProposalName
protected

Definition at line 49 of file budgetproposal.h.

◆ strURL

std::string CBudgetProposal::strURL
protected

Definition at line 50 of file budgetproposal.h.


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