Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
providertx.cpp
Go to the documentation of this file.
67 static bool CheckHashSig(const ProTx& proTx, const CBLSPublicKey& pubKey, CValidationState& state)
86 bool CheckProRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state)
119 // don't allow reuse of payout key for other keys (don't allow people to put the payee key onto an online server)
120 if (payoutDest == CTxDestination(ptx.keyIDOwner) || payoutDest == CTxDestination(ptx.keyIDVoting)) {
124 // It's allowed to set addr to 0, which will put the MN into PoSe-banned state and require a ProUpServTx to be issues later
149 // Extract key from collateral. This only works for P2PK and P2PKH collaterals and will fail for P2SH.
172 // don't allow reuse of collateral key for other keys (don't allow people to put the collateral key onto an online server)
173 // this check applies to internal and external collateral, but internal collaterals are not necessarely a P2PKH
174 if (collateralTxDest == CTxDestination(ptx.keyIDOwner) || collateralTxDest == CTxDestination(ptx.keyIDVoting)) {
181 // only allow reusing of addresses when it's for the same collateral (which replaces the old MN)
182 if (mnList.HasUniqueProperty(ptx.addr) && mnList.GetUniquePropertyMN(ptx.addr)->collateralOutpoint != collateralOutpoint) {
218 bool CheckProUpServTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state)
246 if (mnList.HasUniqueProperty(ptx.addr) && mnList.GetUniquePropertyMN(ptx.addr)->proTxHash != ptx.proTxHash) {
255 if (!ptx.scriptOperatorPayout.IsPayToPublicKeyHash() && !ptx.scriptOperatorPayout.IsPayToScriptHash()) {
274 bool CheckProUpRegTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state)
312 // don't allow reuse of payee key for other keys (don't allow people to put the payee key onto an online server)
313 if (payoutDest == CTxDestination(dmn->pdmnState->keyIDOwner) || payoutDest == CTxDestination(ptx.keyIDVoting)) {
323 // don't allow reuse of collateral key for other keys (don't allow people to put the collateral key onto an online server)
328 if (collateralTxDest == CTxDestination(dmn->pdmnState->keyIDOwner) || collateralTxDest == CTxDestination(ptx.keyIDVoting)) {
358 bool CheckProUpRevTx(const CTransaction& tx, const CBlockIndex* pindexPrev, CValidationState& state)
431 return strprintf("CProRegTx(nVersion=%d, collateralOutpoint=%s, addr=%s, nOperatorReward=%f, ownerAddress=%s, pubKeyOperator=%s, votingAddress=%s, scriptPayout=%s)",
432 nVersion, collateralOutpoint.ToStringShort(), addr.ToString(), (double)nOperatorReward / 100, EncodeDestination(keyIDOwner), pubKeyOperator.ToString(), EncodeDestination(keyIDVoting), payee);
455 return strprintf("CProUpRegTx(nVersion=%d, proTxHash=%s, pubKeyOperator=%s, votingAddress=%s, payoutAddress=%s)",
456 nVersion, proTxHash.ToString(), pubKeyOperator.ToString(), EncodeDestination(keyIDVoting), payee);
bool GetTxPayload(const std::vector< unsigned char > &payload, T &obj)
Definition: specialtx.h:21
bool CheckProUpServTx(const CTransaction &tx, const CBlockIndex *pindexPrev, CValidationState &state)
Definition: providertx.cpp:218
static bool VerifyHash(const uint256 &hash, const CPubKey &pubkey, const std::vector< unsigned char > &vchSig, std::string &strErrorRet)
Verify the hash signature, returns true if succcessful.
Definition: messagesigner.cpp:52
Definition: providertx.h:187
boost::variant< CNoDestination, CKeyID, CScriptID > CTxDestination
A txout script template with a specific destination.
Definition: standard.h:80
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
Definition: standard.cpp:158
std::string ToString(bool fUseGetnameinfo=true) const
Definition: netaddress.cpp:581
Definition: transaction.h:17
static bool CheckStringSig(const ProTx &proTx, const CKeyID &keyID, CValidationState &state)
Definition: providertx.cpp:57
std::string HexStr(const T itbegin, const T itend, bool fSpaces=false)
Definition: utilstrencodings.h:100
bool DoS(int level, bool ret=false, unsigned int chRejectCodeIn=0, const std::string &strRejectReasonIn="", bool corruptionIn=false, const std::string &strDebugMessageIn="")
Definition: validation.h:36
Definition: providertx.h:198
std::unique_ptr< CDeterministicMNManager > deterministicMNManager
Definition: deterministicmns.cpp:24
static bool CheckInputsHash(const CTransaction &tx, const ProTx &proTx, CValidationState &state)
Definition: providertx.cpp:76
static bool VerifyMessage(const CPubKey &pubkey, const std::vector< unsigned char > &vchSig, const std::string &strMessage, std::string &strErrorRet)
Verify the message signature, returns true if succcessful.
Definition: messagesigner.cpp:33
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
Definition: chainparamsbase.h:20
static bool CheckHashSig(const ProTx &proTx, const CKeyID &keyID, CValidationState &state)
Definition: providertx.cpp:47
uint256 SerializeHash(const T &obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION)
Compute the 256-bit hash of an object's serialization.
Definition: hash.h:254
std::unique_ptr< CChainParams > CreateChainParams(const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
Definition: chainparams.cpp:952
Definition: bls.h:263
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:143
bool CheckProRegTx(const CTransaction &tx, const CBlockIndex *pindexPrev, CValidationState &state)
Definition: providertx.cpp:86
bool CheckProUpRevTx(const CTransaction &tx, const CBlockIndex *pindexPrev, CValidationState &state)
Definition: providertx.cpp:358
An outpoint - a combination of a transaction hash and an index n into its vout.
Definition: transaction.h:26
Definition: providertx.h:135
std::string EncodeDestination(const CTxDestination &dest)
Definition: base58.cpp:329
The block chain is a tree shaped structure starting with the genesis block at the root...
Definition: chain.h:170
const CChainParams & Params()
Return the currently selected parameters.
Definition: chainparams.cpp:947
bool CheckProUpRegTx(const CTransaction &tx, const CBlockIndex *pindexPrev, CValidationState &state)
Definition: providertx.cpp:274
static bool CheckService(const uint256 &proTxHash, const ProTx &proTx, CValidationState &state)
Definition: providertx.cpp:21
Definition: providertx.h:88
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:198
Definition: providertx.h:19