PIVX Core  5.6.99
P2P Digital Currency
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MNModel Class Reference

#include <mnmodel.h>

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

Public Types

enum  ColumnIndex {
  ALIAS = 0 , ADDRESS = 1 , PROTO_VERSION = 2 , STATUS = 3 ,
  ACTIVE_TIMESTAMP = 4 , PUB_KEY = 5 , COLLATERAL_ID = 6 , COLLATERAL_OUT_INDEX = 7 ,
  PRIV_KEY = 8 , WAS_COLLATERAL_ACCEPTED = 9
}
 

Public Member Functions

 MNModel (QObject *parent)
 
 ~MNModel () override
 
void init ()
 
void setWalletModel (WalletModel *_model)
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent) const override
 
bool removeMn (const QModelIndex &index)
 
bool addMn (CMasternodeConfig::CMasternodeEntry *entry)
 
void updateMNList ()
 
bool isMNsNetworkSynced ()
 
int getMNState (const QString &mnAlias)
 
bool isMNInactive (const QString &mnAlias)
 
bool isMNActive (const QString &mnAlias)
 
bool isMNCollateralMature (const QString &mnAlias)
 
CAmount getMNCollateralRequiredAmount ()
 
int getMasternodeCollateralMinConf ()
 
bool createMNCollateral (const QString &alias, const QString &addr, COutPoint &ret_outpoint, QString &ret_error)
 
bool startLegacyMN (const CMasternodeConfig::CMasternodeEntry &mne, int chainHeight, std::string &strError)
 
void startAllLegacyMNs (bool onlyMissing, int &amountOfMnFailed, int &amountOfMnStarted, std::string *aliasFilter=nullptr, std::string *error_ret=nullptr)
 
CMasternodeConfig::CMasternodeEntrycreateLegacyMN (COutPoint &collateralOut, const std::string &alias, std::string &serviceAddr, const std::string &port, const std::string &mnKeyString, QString &ret_error)
 
bool removeLegacyMN (const std::string &alias_to_remove, const std::string &tx_id, unsigned int out_index, QString &ret_error)
 
void setCoinControl (CCoinControl *coinControl)
 
void resetCoinControl ()
 

Static Public Member Functions

static bool validateMNIP (const QString &addrStr)
 

Private Attributes

WalletModelwalletModel
 
CCoinControlcoinControl
 
QMap< QString, std::pair< QString, CMasternode * > > nodes
 
QMap< std::string, bool > collateralTxAccepted
 

Detailed Description

Definition at line 14 of file mnmodel.h.

Member Enumeration Documentation

◆ ColumnIndex

Enumerator
ALIAS 

User specified MN alias.

ADDRESS 

Node address.

PROTO_VERSION 

Node protocol version.

STATUS 

Node status.

ACTIVE_TIMESTAMP 
PUB_KEY 
COLLATERAL_ID 
COLLATERAL_OUT_INDEX 
PRIV_KEY 
WAS_COLLATERAL_ACCEPTED 

Definition at line 27 of file mnmodel.h.

Constructor & Destructor Documentation

◆ MNModel()

MNModel::MNModel ( QObject *  parent)
explicit

Definition at line 23 of file mnmodel.cpp.

◆ ~MNModel()

MNModel::~MNModel ( )
inlineoverride

Definition at line 20 of file mnmodel.h.

Member Function Documentation

◆ addMn()

bool MNModel::addMn ( CMasternodeConfig::CMasternodeEntry entry)

Definition at line 151 of file mnmodel.cpp.

Here is the call graph for this function:

◆ columnCount()

int MNModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 62 of file mnmodel.cpp.

◆ createLegacyMN()

CMasternodeConfig::CMasternodeEntry * MNModel::createLegacyMN ( COutPoint collateralOut,
const std::string &  alias,
std::string &  serviceAddr,
const std::string &  port,
const std::string &  mnKeyString,
QString &  ret_error 
)

Definition at line 318 of file mnmodel.cpp.

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

◆ createMNCollateral()

bool MNModel::createMNCollateral ( const QString &  alias,
const QString &  addr,
COutPoint ret_outpoint,
QString &  ret_error 
)

Definition at line 210 of file mnmodel.cpp.

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

◆ data()

QVariant MNModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Definition at line 70 of file mnmodel.cpp.

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

◆ getMasternodeCollateralMinConf()

int MNModel::getMasternodeCollateralMinConf ( )

Definition at line 205 of file mnmodel.cpp.

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

◆ getMNCollateralRequiredAmount()

CAmount MNModel::getMNCollateralRequiredAmount ( )

Definition at line 200 of file mnmodel.cpp.

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

◆ getMNState()

int MNModel::getMNState ( const QString &  mnAlias)

Definition at line 164 of file mnmodel.cpp.

Here is the caller graph for this function:

◆ index()

QModelIndex MNModel::index ( int  row,
int  column,
const QModelIndex &  parent 
) const
override

Definition at line 125 of file mnmodel.cpp.

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

◆ init()

void MNModel::init ( )

Definition at line 25 of file mnmodel.cpp.

Here is the call graph for this function:

◆ isMNActive()

bool MNModel::isMNActive ( const QString &  mnAlias)

Definition at line 177 of file mnmodel.cpp.

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

◆ isMNCollateralMature()

bool MNModel::isMNCollateralMature ( const QString &  mnAlias)

Definition at line 183 of file mnmodel.cpp.

Here is the caller graph for this function:

◆ isMNInactive()

bool MNModel::isMNInactive ( const QString &  mnAlias)

Definition at line 171 of file mnmodel.cpp.

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

◆ isMNsNetworkSynced()

bool MNModel::isMNsNetworkSynced ( )

Definition at line 190 of file mnmodel.cpp.

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

◆ removeLegacyMN()

bool MNModel::removeLegacyMN ( const std::string &  alias_to_remove,
const std::string &  tx_id,
unsigned int  out_index,
QString &  ret_error 
)

Definition at line 417 of file mnmodel.cpp.

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

◆ removeMn()

bool MNModel::removeMn ( const QModelIndex &  index)

Definition at line 140 of file mnmodel.cpp.

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

◆ resetCoinControl()

void MNModel::resetCoinControl ( )

Definition at line 513 of file mnmodel.cpp.

Here is the caller graph for this function:

◆ rowCount()

int MNModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Definition at line 55 of file mnmodel.cpp.

Here is the caller graph for this function:

◆ setCoinControl()

void MNModel::setCoinControl ( CCoinControl coinControl)

Definition at line 508 of file mnmodel.cpp.

◆ setWalletModel()

void MNModel::setWalletModel ( WalletModel _model)
inline

Definition at line 25 of file mnmodel.h.

◆ startAllLegacyMNs()

void MNModel::startAllLegacyMNs ( bool  onlyMissing,
int &  amountOfMnFailed,
int &  amountOfMnStarted,
std::string *  aliasFilter = nullptr,
std::string *  error_ret = nullptr 
)

Definition at line 286 of file mnmodel.cpp.

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

◆ startLegacyMN()

bool MNModel::startLegacyMN ( const CMasternodeConfig::CMasternodeEntry mne,
int  chainHeight,
std::string &  strError 
)

Definition at line 272 of file mnmodel.cpp.

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

◆ updateMNList()

void MNModel::updateMNList ( )

Definition at line 30 of file mnmodel.cpp.

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

◆ validateMNIP()

bool MNModel::validateMNIP ( const QString &  addrStr)
static

Definition at line 195 of file mnmodel.cpp.

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

Member Data Documentation

◆ coinControl

CCoinControl* MNModel::coinControl
private

Definition at line 85 of file mnmodel.h.

◆ collateralTxAccepted

QMap<std::string, bool> MNModel::collateralTxAccepted
private

Definition at line 88 of file mnmodel.h.

◆ nodes

QMap<QString, std::pair<QString, CMasternode*> > MNModel::nodes
private

Definition at line 87 of file mnmodel.h.

◆ walletModel

WalletModel* MNModel::walletModel
private

Definition at line 84 of file mnmodel.h.


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