 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
7 #ifndef MASTERNODE_BUDGET_H
8 #define MASTERNODE_BUDGET_H
29 #define VOTE_ABSTAIN 0
33 static const CAmount PROPOSAL_FEE_TX = (50 * COIN);
34 static const CAmount BUDGET_FEE_TX = (50 * COIN);
35 static const int64_t BUDGET_VOTE_UPDATE_MIN = 60 * 60;
73 std::string ret =
"ABSTAIN";
91 template <
typename Stream,
typename Operation>
92 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion)
134 template <
typename Stream,
typename Operation>
221 std::pair<std::string, std::string>
GetVotes(std::string strProposalName);
224 std::vector<CBudgetProposal*>
GetBudget();
260 template <
typename Stream,
typename Operation>
293 template <
typename Stream,
typename Operation>
330 bool IsValid(std::string& strError,
bool fCheckCollateral =
true);
343 if (i < 0)
return false;
353 if (i < 0)
return false;
384 template <
typename Stream,
typename Operation>
435 template <
typename Stream,
typename Operation>
484 std::pair<std::string, std::string>
GetVotes();
486 bool IsValid(std::string& strError,
bool fCheckCollateral =
true);
533 template <
typename Stream,
typename Operation>
589 template <
typename Stream,
typename Operation>
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::vector< CBudgetProposalBroadcast > vecImmatureBudgetProposals
bool PropExists(uint256 nHash)
An input of a transaction.
bool HasMinimumRequiredSupport()
const uint256 UINT256_ZERO
constant uint256 instances
std::map< uint256, CBudgetProposalBroadcast > mapSeenMasternodeBudgetProposals
std::string GetVoteString()
std::vector< CFinalizedBudget * > GetFinalizedBudgets()
CFinalizedBudget * FindFinalizedBudget(uint256 nHash)
bool Sign(CKey &keyMasternode, CPubKey &pubKeyMasternode)
bool AddOrUpdateVote(CFinalizedBudgetVote &vote, std::string &strError)
bool SignatureValid(bool fSignatureCheck)
int64_t GetTime()
For unit testing.
CBudgetProposalBroadcast(const CBudgetProposal &other)
std::map< uint256, CBudgetVote > mapOrphanMasternodeBudgetVotes
std::map< uint256, CFinalizedBudgetBroadcast > mapSeenFinalizedBudgets
std::vector< CTxBudgetPayment > vecBudgetPayments
CBudgetProposalBroadcast & operator=(CBudgetProposalBroadcast from)
std::map< uint256, CBudgetVote > mapSeenMasternodeBudgetVotes
std::vector< CBudgetProposal * > GetAllProposals()
std::vector< unsigned char > vchSig
Information about a peer.
int GetTotalPaymentCount()
std::string strMagicMessage
bool UpdateProposal(CBudgetVote &vote, CNode *pfrom, std::string &strError)
std::string GetProposals()
int GetRemainingPaymentCount()
bool IsBudgetCollateralValid(uint256 nTxCollateralHash, uint256 nExpectedHash, std::string &strError, int64_t &nTime, int &nConf)
CFinalizedBudgetBroadcast()
std::string strBudgetName
std::string ToString() const
The basic transaction that is broadcasted on the network and contained in blocks.
std::map< uint256, CBudgetProposal > mapProposals
bool UpdateFinalizedBudget(CFinalizedBudgetVote &vote, CNode *pfrom, std::string &strError)
std::vector< CFinalizedBudgetBroadcast > vecImmatureFinalizedBudgets
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool IsBudgetPaymentBlock(int nBlockHeight)
CFinalizedBudgetBroadcast & operator=(CFinalizedBudgetBroadcast from)
std::vector< CBudgetProposal * > GetBudget()
void Sync(CNode *node, uint256 nProp, bool fPartial=false)
void swap(CBudgetProposalBroadcast &first, CBudgetProposalBroadcast &second)
std::pair< std::string, std::string > GetVotes()
std::map< uint256, CFinalizedBudget > mapFinalizedBudgets
bool AddOrUpdateVote(CBudgetVote &vote, std::string &strError)
bool SignatureValid(bool fSignatureCheck)
bool IsTransactionValid(const CTransaction &txNew, int nBlockHeight)
int64_t CAmount
Amount in PRCY (Can be negative)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
bool Sign(CKey &keyMasternode, CPubKey &pubKeyMasternode)
bool GetBudgetPaymentByBlock(int64_t nBlockHeight, CTxBudgetPayment &payment)
bool FillBlockPayee(CMutableTransaction &txNew, CAmount nFees, bool fProofOfStake)
256-bit unsigned big integer.
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
CBudgetProposal * FindProposal(const std::string &strProposalName)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::map< uint256, uint256 > mapCollateralTxids
bool GetPayeeAndAmount(int64_t nBlockHeight, CScript &payee, CAmount &nAmount)
Serialized script, used inside transaction inputs and outputs.
int GetBlockCurrentCycle()
std::string GetRequiredPaymentsString(int nBlockHeight)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
void SetAllotted(CAmount nAllotedIn)
std::vector< unsigned char > vchSig
Implements a drop-in replacement for std::vector<T> which stores up to N elements directly (without h...
CBudgetProposalBroadcast(const CBudgetProposalBroadcast &other)
An encapsulated public key.
void ProcessMessage(CNode *pfrom, std::string &strCommand, CDataStream &vRecv)
bool IsValid(std::string &strError, bool fCheckCollateral=true)
std::vector< unsigned char > vchSig
An encapsulated private key.
bool AddProposal(CBudgetProposal &budgetProposal)
void CleanAndRemove(bool fSignatureCheck)
bool IsValid(std::string &strError, bool fCheckCollateral=true)
A writer stream (for serialization) that computes a 256-bit hash.
bool IsTransactionValid(const CTransaction &txNew, int nBlockHeight)
const CChainParams & Params()
Return the currently selected parameters.
std::pair< std::string, std::string > GetVotes(std::string strProposalName)
bool AddFinalizedBudget(CFinalizedBudget &finalizedBudget)
bool Write(const CBudgetManager &objToSave)
Double ended buffer combining vector and stream-like interfaces.
bool HasMinimumRequiredSupport()
int GetBudgetPaymentCycleBlocks()
ReadResult Read(CBudgetManager &objToLoad, bool fDryRun=false)
std::map< uint256, CBudgetVote > mapVotes
std::map< uint256, CFinalizedBudgetVote > mapVotes
A mutable version of CTransaction.
std::map< uint256, CFinalizedBudgetVote > mapSeenFinalizedBudgetVotes
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::map< uint256, CFinalizedBudgetVote > mapOrphanFinalizedBudgetVotes
#define LIMITED_STRING(obj, n)
CAmount GetTotalBudget(int nHeight)
Save Budget Manager (budget.dat)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
void CleanAndRemove(bool fSignatureCheck)
void swap(CFinalizedBudgetBroadcast &first, CFinalizedBudgetBroadcast &second)
CBudgetProposalBroadcast()
std::string strProposalName