![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
#include <budgetmanager.h>
Classes | |
| struct | HighestFinBudget |
Public Member Functions | |
| CBudgetManager () | |
| void | UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override |
| Notifies listeners when the block chain tip advances. More... | |
| bool | HaveProposal (const uint256 &propHash) const |
| bool | HaveSeenProposalVote (const uint256 &voteHash) const |
| bool | HaveFinalizedBudget (const uint256 &budgetHash) const |
| bool | HaveSeenFinalizedBudgetVote (const uint256 &voteHash) const |
| void | ReloadMapSeen () |
| void | AddSeenProposalVote (const CBudgetVote &vote) |
| void | AddSeenFinalizedBudgetVote (const CFinalizedBudgetVote &vote) |
| void | RemoveStaleVotesOnProposal (CBudgetProposal *prop) |
| void | RemoveStaleVotesOnFinalBudget (CFinalizedBudget *fbud) |
| CDataStream | GetProposalVoteSerialized (const uint256 &voteHash) const |
| CDataStream | GetProposalSerialized (const uint256 &propHash) const |
| CDataStream | GetFinalizedBudgetVoteSerialized (const uint256 &voteHash) const |
| CDataStream | GetFinalizedBudgetSerialized (const uint256 &budgetHash) const |
| bool | AddAndRelayProposalVote (const CBudgetVote &vote, std::string &strError) |
| void | SetBudgetProposalsStr (CFinalizedBudget &finalizedBudget) const |
| std::string | GetFinalizedBudgetStatus (const uint256 &nHash) const |
| void | ResetSync () |
| void | MarkSynced () |
| void | Sync (CNode *node, bool fPartial) |
| void | SyncSingleItem (CNode *pfrom, const uint256 &nProp) |
| void | SetBestHeight (int height) |
| int | GetBestHeight () const |
| bool | ProcessMessage (CNode *pfrom, std::string &strCommand, CDataStream &vRecv, int &banScore) |
| int | ProcessMessageInner (CNode *pfrom, std::string &strCommand, CDataStream &vRecv) |
| Process the message and returns the ban score (0 if no banning is needed) More... | |
| int | ProcessBudgetVoteSync (const uint256 &nProp, CNode *pfrom) |
| int | ProcessProposal (CBudgetProposal &proposal) |
| int | ProcessFinalizedBudget (CFinalizedBudget &finalbudget, CNode *pfrom) |
| bool | ProcessProposalVote (CBudgetVote &proposal, CNode *pfrom, CValidationState &state) |
| bool | ProcessFinalizedBudgetVote (CFinalizedBudgetVote &vote, CNode *pfrom, CValidationState &state) |
| CBudgetProposal * | FindProposal (const uint256 &nHash) |
| CFinalizedBudget * | FindFinalizedBudget (const uint256 &nHash) |
| bool | GetProposal (const uint256 &nHash, CBudgetProposal &bp) const |
| bool | GetFinalizedBudget (const uint256 &nHash, CFinalizedBudget &fb) const |
| const CBudgetProposal * | FindProposalByName (const std::string &strProposalName) const |
| bool | HasAnyProposal () const |
| std::vector< CBudgetProposal > | GetBudget () |
| std::vector< CBudgetProposal * > | GetAllProposalsOrdered () |
| std::vector< CFinalizedBudget * > | GetFinalizedBudgets () |
| bool | GetExpectedPayeeAmount (int chainHeight, CAmount &nAmountRet) const |
| bool | IsBudgetPaymentBlock (int nBlockHeight) const |
| bool | IsBudgetPaymentBlock (int nBlockHeight, int &nCountThreshold) const |
| bool | AddProposal (CBudgetProposal &budgetProposal) |
| bool | AddFinalizedBudget (CFinalizedBudget &finalizedBudget, CNode *pfrom=nullptr) |
| void | ForceAddFinalizedBudget (const uint256 &nHash, const uint256 &feeTxId, const CFinalizedBudget &finalizedBudget) |
| uint256 | SubmitFinalBudget () |
| bool | UpdateProposal (const CBudgetVote &vote, CNode *pfrom, std::string &strError) |
| bool | UpdateFinalizedBudget (const CFinalizedBudgetVote &vote, CNode *pfrom, std::string &strError) |
| TrxValidationStatus | IsTransactionValid (const CTransaction &txNew, const uint256 &nBlockHash, int nBlockHeight) const |
| std::string | GetRequiredPaymentsString (int nBlockHeight) |
| bool | FillBlockPayee (CMutableTransaction &txCoinbase, CMutableTransaction &txCoinstake, const int nHeight, bool fProofOfStake) const |
| void | VoteOnFinalizedBudgets () |
| int | CountProposals () |
| void | CheckOrphanVotes () |
| void | Clear () |
| void | CheckAndRemove () |
| std::string | ToString () const |
| void | RemoveByFeeTxId (const uint256 &feeTxId) |
| SERIALIZE_METHODS (CBudgetManager, obj) | |
Public Member Functions inherited from CValidationInterface | |
| virtual | ~CValidationInterface ()=default |
| virtual void | AcceptedBlockHeader (const CBlockIndex *pindexNew) |
Static Public Member Functions | |
| static CAmount | GetTotalBudget (int nHeight) |
Public Attributes | |
| RecursiveMutex | cs_budgets |
| RecursiveMutex | cs_proposals |
| RecursiveMutex | cs_finalizedvotes |
| RecursiveMutex | cs_votes |
| std::string | strBudgetMode |
Protected Types | |
| typedef std::pair< std::vector< CBudgetVote >, int64_t > | PropVotesAndLastVoteReceivedTime |
| typedef std::pair< std::vector< CFinalizedBudgetVote >, int64_t > | BudVotesAndLastVoteReceivedTime |
Protected Member Functions | |
| HighestFinBudget | GetBudgetWithHighestVoteCount (int chainHeight) const |
| int | GetHighestVoteCount (int chainHeight) const |
| bool | GetPayeeAndAmount (int chainHeight, CScript &payeeRet, CAmount &nAmountRet) const |
| void | SetSynced (bool synced) |
Protected Member Functions inherited from CValidationInterface | |
| virtual void | TransactionAddedToMempool (const CTransactionRef &ptxn) |
| Notifies listeners of a transaction having been added to mempool. More... | |
| virtual void | TransactionRemovedFromMempool (const CTransactionRef &ptx, MemPoolRemovalReason reason) |
| Notifies listeners of a transaction leaving mempool. More... | |
| virtual void | BlockConnected (const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex) |
| Notifies listeners of a block being connected. More... | |
| virtual void | BlockDisconnected (const std::shared_ptr< const CBlock > &block, const uint256 &blockHash, int nBlockHeight, int64_t blockTime) |
| Notifies listeners of a block being disconnected. More... | |
| virtual void | SetBestChain (const CBlockLocator &locator) |
| Notifies listeners of the new active block chain on-disk. More... | |
| virtual void | ResendWalletTransactions (CConnman *connman) |
| Tells listeners to broadcast their data. More... | |
| virtual void | BlockChecked (const CBlock &, const CValidationState &) |
| friend | void ::RegisterSharedValidationInterface (std::shared_ptr< CValidationInterface >) |
| friend | void ::UnregisterValidationInterface (CValidationInterface *) |
| friend | void ::UnregisterAllValidationInterfaces () |
| virtual void | NotifyMasternodeListChanged (bool undo, const CDeterministicMNList &oldMNList, const CDeterministicMNListDiff &diff) |
| Notifies listeners of updated deterministic masternode list. More... | |
Protected Attributes | |
| std::map< uint256, uint256 > | mapUnconfirmedFeeTx |
| std::map< uint256, uint256 > | mapFeeTxToProposal |
| std::map< uint256, uint256 > | mapFeeTxToBudget |
| std::map< uint256, CBudgetProposal > | mapProposals |
| std::map< uint256, CFinalizedBudget > | mapFinalizedBudgets |
| std::map< uint256, CBudgetVote > | mapSeenProposalVotes |
| std::map< uint256, PropVotesAndLastVoteReceivedTime > | mapOrphanProposalVotes |
| std::map< uint256, CFinalizedBudgetVote > | mapSeenFinalizedBudgetVotes |
| std::map< uint256, BudVotesAndLastVoteReceivedTime > | mapOrphanFinalizedBudgetVotes |
| std::atomic< int > | nBestHeight |
Definition at line 20 of file budgetmanager.h.
|
protected |
Definition at line 39 of file budgetmanager.h.
|
protected |
Definition at line 36 of file budgetmanager.h.
|
inline |
Definition at line 68 of file budgetmanager.h.
| bool CBudgetManager::AddAndRelayProposalVote | ( | const CBudgetVote & | vote, |
| std::string & | strError | ||
| ) |
| bool CBudgetManager::AddFinalizedBudget | ( | CFinalizedBudget & | finalizedBudget, |
| CNode * | pfrom = nullptr |
||
| ) |
Definition at line 251 of file budgetmanager.cpp.
| bool CBudgetManager::AddProposal | ( | CBudgetProposal & | budgetProposal | ) |
Definition at line 328 of file budgetmanager.cpp.
| void CBudgetManager::AddSeenFinalizedBudgetVote | ( | const CFinalizedBudgetVote & | vote | ) |
| void CBudgetManager::AddSeenProposalVote | ( | const CBudgetVote & | vote | ) |
Definition at line 872 of file budgetmanager.cpp.
| void CBudgetManager::CheckAndRemove | ( | ) |
Definition at line 371 of file budgetmanager.cpp.
| void CBudgetManager::CheckOrphanVotes | ( | ) |
Definition at line 51 of file budgetmanager.cpp.
|
inline |
|
inline |
| bool CBudgetManager::FillBlockPayee | ( | CMutableTransaction & | txCoinbase, |
| CMutableTransaction & | txCoinstake, | ||
| const int | nHeight, | ||
| bool | fProofOfStake | ||
| ) | const |
Definition at line 518 of file budgetmanager.cpp.
| CFinalizedBudget * CBudgetManager::FindFinalizedBudget | ( | const uint256 & | nHash | ) |
Definition at line 642 of file budgetmanager.cpp.
| CBudgetProposal * CBudgetManager::FindProposal | ( | const uint256 & | nHash | ) |
| const CBudgetProposal * CBudgetManager::FindProposalByName | ( | const std::string & | strProposalName | ) | const |
Definition at line 649 of file budgetmanager.cpp.
| void CBudgetManager::ForceAddFinalizedBudget | ( | const uint256 & | nHash, |
| const uint256 & | feeTxId, | ||
| const CFinalizedBudget & | finalizedBudget | ||
| ) |
| std::vector< CBudgetProposal * > CBudgetManager::GetAllProposalsOrdered | ( | ) |
Definition at line 750 of file budgetmanager.cpp.
|
inline |
| std::vector< CBudgetProposal > CBudgetManager::GetBudget | ( | ) |
Definition at line 763 of file budgetmanager.cpp.
|
protected |
Definition at line 477 of file budgetmanager.cpp.
| bool CBudgetManager::GetExpectedPayeeAmount | ( | int | chainHeight, |
| CAmount & | nAmountRet | ||
| ) | const |
Definition at line 512 of file budgetmanager.cpp.
| bool CBudgetManager::GetFinalizedBudget | ( | const uint256 & | nHash, |
| CFinalizedBudget & | fb | ||
| ) | const |
| std::vector< CFinalizedBudget * > CBudgetManager::GetFinalizedBudgets | ( | ) |
Definition at line 814 of file budgetmanager.cpp.
| CDataStream CBudgetManager::GetFinalizedBudgetSerialized | ( | const uint256 & | budgetHash | ) | const |
Definition at line 955 of file budgetmanager.cpp.
| std::string CBudgetManager::GetFinalizedBudgetStatus | ( | const uint256 & | nHash | ) | const |
| CDataStream CBudgetManager::GetFinalizedBudgetVoteSerialized | ( | const uint256 & | voteHash | ) | const |
Definition at line 946 of file budgetmanager.cpp.
|
protected |
Definition at line 495 of file budgetmanager.cpp.
|
protected |
Definition at line 501 of file budgetmanager.cpp.
| bool CBudgetManager::GetProposal | ( | const uint256 & | nHash, |
| CBudgetProposal & | bp | ||
| ) | const |
| CDataStream CBudgetManager::GetProposalSerialized | ( | const uint256 & | propHash | ) | const |
Definition at line 940 of file budgetmanager.cpp.
| CDataStream CBudgetManager::GetProposalVoteSerialized | ( | const uint256 & | voteHash | ) | const |
Definition at line 931 of file budgetmanager.cpp.
| std::string CBudgetManager::GetRequiredPaymentsString | ( | int | nBlockHeight | ) |
Definition at line 829 of file budgetmanager.cpp.
|
static |
Definition at line 858 of file budgetmanager.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool CBudgetManager::IsBudgetPaymentBlock | ( | int | nBlockHeight | ) | const |
| bool CBudgetManager::IsBudgetPaymentBlock | ( | int | nBlockHeight, |
| int & | nCountThreshold | ||
| ) | const |
| TrxValidationStatus CBudgetManager::IsTransactionValid | ( | const CTransaction & | txNew, |
| const uint256 & | nBlockHash, | ||
| int | nBlockHeight | ||
| ) | const |
Definition at line 716 of file budgetmanager.cpp.
|
inline |
Definition at line 102 of file budgetmanager.h.
Definition at line 1048 of file budgetmanager.cpp.
| int CBudgetManager::ProcessFinalizedBudget | ( | CFinalizedBudget & | finalbudget, |
| CNode * | pfrom | ||
| ) |
Definition at line 1175 of file budgetmanager.cpp.
| bool CBudgetManager::ProcessFinalizedBudgetVote | ( | CFinalizedBudgetVote & | vote, |
| CNode * | pfrom, | ||
| CValidationState & | state | ||
| ) |
Definition at line 1198 of file budgetmanager.cpp.
| bool CBudgetManager::ProcessMessage | ( | CNode * | pfrom, |
| std::string & | strCommand, | ||
| CDataStream & | vRecv, | ||
| int & | banScore | ||
| ) |
| int CBudgetManager::ProcessMessageInner | ( | CNode * | pfrom, |
| std::string & | strCommand, | ||
| CDataStream & | vRecv | ||
| ) |
Process the message and returns the ban score (0 if no banning is needed)
Definition at line 1289 of file budgetmanager.cpp.
| int CBudgetManager::ProcessProposal | ( | CBudgetProposal & | proposal | ) |
Definition at line 1067 of file budgetmanager.cpp.
| bool CBudgetManager::ProcessProposalVote | ( | CBudgetVote & | proposal, |
| CNode * | pfrom, | ||
| CValidationState & | state | ||
| ) |
Definition at line 1089 of file budgetmanager.cpp.
| void CBudgetManager::ReloadMapSeen | ( | ) |
| void CBudgetManager::RemoveByFeeTxId | ( | const uint256 & | feeTxId | ) |
| void CBudgetManager::RemoveStaleVotesOnFinalBudget | ( | CFinalizedBudget * | fbud | ) |
Definition at line 908 of file budgetmanager.cpp.
| void CBudgetManager::RemoveStaleVotesOnProposal | ( | CBudgetProposal * | prop | ) |
Definition at line 884 of file budgetmanager.cpp.
|
inline |
Definition at line 101 of file budgetmanager.h.
|
inline |
Definition at line 189 of file budgetmanager.h.
|
inline |
| void CBudgetManager::SetBudgetProposalsStr | ( | CFinalizedBudget & | finalizedBudget | ) | const |
Definition at line 200 of file budgetmanager.cpp.
|
protected |
Definition at line 1376 of file budgetmanager.cpp.
| uint256 CBudgetManager::SubmitFinalBudget | ( | ) |
Definition at line 100 of file budgetmanager.cpp.
| void CBudgetManager::Sync | ( | CNode * | node, |
| bool | fPartial | ||
| ) |
Definition at line 1451 of file budgetmanager.cpp.
| std::string CBudgetManager::ToString | ( | ) | const |
Definition at line 1553 of file budgetmanager.cpp.
|
overridevirtual |
Notifies listeners when the block chain tip advances.
When multiple blocks are connected at once, UpdatedBlockTip will be called on the final tip but may not be called on every intermediate tip. If the latter behavior is desired, subscribe to BlockConnected() instead.
Called on a background thread.
Reimplemented from CValidationInterface.
Definition at line 971 of file budgetmanager.cpp.
| bool CBudgetManager::UpdateFinalizedBudget | ( | const CFinalizedBudgetVote & | vote, |
| CNode * | pfrom, | ||
| std::string & | strError | ||
| ) |
| bool CBudgetManager::UpdateProposal | ( | const CBudgetVote & | vote, |
| CNode * | pfrom, | ||
| std::string & | strError | ||
| ) |
Definition at line 1491 of file budgetmanager.cpp.
| void CBudgetManager::VoteOnFinalizedBudgets | ( | ) |
Definition at line 561 of file budgetmanager.cpp.
|
mutable |
Definition at line 60 of file budgetmanager.h.
|
mutable |
Definition at line 62 of file budgetmanager.h.
|
mutable |
Definition at line 61 of file budgetmanager.h.
|
mutable |
Definition at line 63 of file budgetmanager.h.
Definition at line 30 of file budgetmanager.h.
Definition at line 29 of file budgetmanager.h.
|
protected |
Definition at line 33 of file budgetmanager.h.
|
protected |
Definition at line 40 of file budgetmanager.h.
|
protected |
Definition at line 37 of file budgetmanager.h.
|
protected |
Definition at line 32 of file budgetmanager.h.
|
protected |
Definition at line 38 of file budgetmanager.h.
|
protected |
Definition at line 35 of file budgetmanager.h.
Definition at line 25 of file budgetmanager.h.
|
protected |
Definition at line 43 of file budgetmanager.h.
| std::string CBudgetManager::strBudgetMode |
Definition at line 66 of file budgetmanager.h.