PIVX Core  5.6.99
P2P Digital Currency
Public Slots | Public Member Functions | Private Member Functions | Private Attributes | List of all members
GovernanceModel Class Reference

#include <governancemodel.h>

Inheritance diagram for GovernanceModel:
[legend]
Collaboration diagram for GovernanceModel:
[legend]

Public Slots

void pollGovernanceChanged ()
 
void txLoaded (const QString &hash, const int txType, const int txStatus)
 

Public Member Functions

 GovernanceModel (ClientModel *_clientModel, MNModel *_mnModel)
 
 ~GovernanceModel () override
 
void setWalletModel (WalletModel *_walletModel)
 
std::list< ProposalInfogetProposals (const ProposalInfo::Status *filterByStatus=nullptr, bool filterFinished=true)
 
bool hasProposals ()
 
bool isRefreshNeeded ()
 
int getNumBlocksPerBudgetCycle () const
 
int getProposalVoteUpdateMinTime () const
 
CAmount getMaxAvailableBudgetAmount () const
 
int getPropMaxPaymentsCount () const
 
CAmount getProposalFeeAmount () const
 
int getNextSuperblockHeight () const
 
CAmount getBudgetAllocatedAmount () const
 
CAmount getBudgetAvailableAmount () const
 
std::vector< VoteInfogetLocalMNsVotesForProposal (const ProposalInfo &propInfo)
 
OperationResult validatePropURL (const QString &url) const
 
OperationResult validatePropName (const QString &name) const
 
OperationResult validatePropAmount (CAmount amount) const
 
OperationResult validatePropPaymentCount (int paymentCount) const
 
bool isTierTwoSync ()
 
OperationResult createProposal (const std::string &strProposalName, const std::string &strURL, int nPaymentCount, CAmount nAmount, const std::string &strPaymentAddr)
 
OperationResult voteForProposal (const ProposalInfo &prop, bool isVotePositive, const std::vector< std::string > &mnVotingAlias)
 
void stop ()
 

Private Member Functions

void scheduleBroadcast (const CBudgetProposal &proposal)
 
ProposalInfo buildProposalInfo (const CBudgetProposal *prop, bool isPassing, bool isPending)
 

Private Attributes

ClientModelclientModel {nullptr}
 
WalletModelwalletModel {nullptr}
 
MNModelmnModel {nullptr}
 
std::atomic< bool > refreshNeeded {false}
 
CAmount allocatedAmount {0}
 
QTimer * pollTimer {nullptr}
 
std::vector< CBudgetProposalwaitingPropsForConfirmations
 

Detailed Description

Definition at line 89 of file governancemodel.h.

Constructor & Destructor Documentation

◆ GovernanceModel()

GovernanceModel::GovernanceModel ( ClientModel _clientModel,
MNModel _mnModel 
)
explicit

Definition at line 39 of file governancemodel.cpp.

◆ ~GovernanceModel()

GovernanceModel::~GovernanceModel ( )
override

Definition at line 40 of file governancemodel.cpp.

Member Function Documentation

◆ buildProposalInfo()

ProposalInfo GovernanceModel::buildProposalInfo ( const CBudgetProposal prop,
bool  isPassing,
bool  isPending 
)
private

Definition at line 48 of file governancemodel.cpp.

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

◆ createProposal()

OperationResult GovernanceModel::createProposal ( const std::string &  strProposalName,
const std::string &  strURL,
int  nPaymentCount,
CAmount  nAmount,
const std::string &  strPaymentAddr 
)

Definition at line 232 of file governancemodel.cpp.

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

◆ getBudgetAllocatedAmount()

CAmount GovernanceModel::getBudgetAllocatedAmount ( ) const
inline

Definition at line 116 of file governancemodel.h.

Here is the caller graph for this function:

◆ getBudgetAvailableAmount()

CAmount GovernanceModel::getBudgetAvailableAmount ( ) const
inline

Definition at line 117 of file governancemodel.h.

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

◆ getLocalMNsVotesForProposal()

std::vector< VoteInfo > GovernanceModel::getLocalMNsVotesForProposal ( const ProposalInfo propInfo)

Definition at line 153 of file governancemodel.cpp.

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

◆ getMaxAvailableBudgetAmount()

CAmount GovernanceModel::getMaxAvailableBudgetAmount ( ) const

Definition at line 121 of file governancemodel.cpp.

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

◆ getNextSuperblockHeight()

int GovernanceModel::getNextSuperblockHeight ( ) const

Definition at line 146 of file governancemodel.cpp.

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

◆ getNumBlocksPerBudgetCycle()

int GovernanceModel::getNumBlocksPerBudgetCycle ( ) const

Definition at line 126 of file governancemodel.cpp.

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

◆ getPropMaxPaymentsCount()

int GovernanceModel::getPropMaxPaymentsCount ( ) const

Definition at line 136 of file governancemodel.cpp.

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

◆ getProposalFeeAmount()

CAmount GovernanceModel::getProposalFeeAmount ( ) const

Definition at line 141 of file governancemodel.cpp.

Here is the caller graph for this function:

◆ getProposals()

std::list< ProposalInfo > GovernanceModel::getProposals ( const ProposalInfo::Status filterByStatus = nullptr,
bool  filterFinished = true 
)

Definition at line 89 of file governancemodel.cpp.

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

◆ getProposalVoteUpdateMinTime()

int GovernanceModel::getProposalVoteUpdateMinTime ( ) const

Definition at line 131 of file governancemodel.cpp.

Here is the caller graph for this function:

◆ hasProposals()

bool GovernanceModel::hasProposals ( )

Definition at line 116 of file governancemodel.cpp.

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

◆ isRefreshNeeded()

bool GovernanceModel::isRefreshNeeded ( )
inline

Definition at line 103 of file governancemodel.h.

Here is the caller graph for this function:

◆ isTierTwoSync()

bool GovernanceModel::isTierTwoSync ( )

Definition at line 227 of file governancemodel.cpp.

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

◆ pollGovernanceChanged

void GovernanceModel::pollGovernanceChanged ( )
slot

Definition at line 298 of file governancemodel.cpp.

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

◆ scheduleBroadcast()

void GovernanceModel::scheduleBroadcast ( const CBudgetProposal proposal)
private

Definition at line 284 of file governancemodel.cpp.

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

◆ setWalletModel()

void GovernanceModel::setWalletModel ( WalletModel _walletModel)

Definition at line 42 of file governancemodel.cpp.

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

◆ stop()

void GovernanceModel::stop ( )

Definition at line 341 of file governancemodel.cpp.

◆ txLoaded

void GovernanceModel::txLoaded ( const QString &  hash,
const int  txType,
const int  txStatus 
)
slot

Definition at line 348 of file governancemodel.cpp.

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

◆ validatePropAmount()

OperationResult GovernanceModel::validatePropAmount ( CAmount  amount) const

Definition at line 205 of file governancemodel.cpp.

Here is the caller graph for this function:

◆ validatePropName()

OperationResult GovernanceModel::validatePropName ( const QString &  name) const

Definition at line 183 of file governancemodel.cpp.

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

◆ validatePropPaymentCount()

OperationResult GovernanceModel::validatePropPaymentCount ( int  paymentCount) const

Definition at line 217 of file governancemodel.cpp.

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

◆ validatePropURL()

OperationResult GovernanceModel::validatePropURL ( const QString &  url) const

Definition at line 195 of file governancemodel.cpp.

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

◆ voteForProposal()

OperationResult GovernanceModel::voteForProposal ( const ProposalInfo prop,
bool  isVotePositive,
const std::vector< std::string > &  mnVotingAlias 
)

Definition at line 260 of file governancemodel.cpp.

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

Member Data Documentation

◆ allocatedAmount

CAmount GovernanceModel::allocatedAmount {0}
private

Definition at line 155 of file governancemodel.h.

◆ clientModel

ClientModel* GovernanceModel::clientModel {nullptr}
private

Definition at line 149 of file governancemodel.h.

◆ mnModel

MNModel* GovernanceModel::mnModel {nullptr}
private

Definition at line 151 of file governancemodel.h.

◆ pollTimer

QTimer* GovernanceModel::pollTimer {nullptr}
private

Definition at line 157 of file governancemodel.h.

◆ refreshNeeded

std::atomic<bool> GovernanceModel::refreshNeeded {false}
private

Definition at line 152 of file governancemodel.h.

◆ waitingPropsForConfirmations

std::vector<CBudgetProposal> GovernanceModel::waitingPropsForConfirmations
private

Definition at line 160 of file governancemodel.h.

◆ walletModel

WalletModel* GovernanceModel::walletModel {nullptr}
private

Definition at line 150 of file governancemodel.h.


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