Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
spork.h
Go to the documentation of this file.
224 void ProcessSpork(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
Definition: spork.h:28
std::size_t operator()(SporkId const &id) const noexcept
Definition: spork.h:40
bool UpdateSpork(SporkId nSporkID, int64_t nValue, CConnman &connman)
UpdateSpork is used by the spork RPC command to set a new spork value, sign and broadcast the spork m...
Definition: spork.cpp:185
bool Sign(const CKey &key)
Sign will sign the spork message with the given key.
Definition: spork.cpp:339
If none of the specialized versions above matched and T is an enum, default to calling Serialize/Unse...
Definition: params.h:197
SporkId GetSporkIDByName(const std::string &strName)
GetSporkIDByName returns the internal Spork ID given the spork name.
Definition: spork.cpp:235
void ProcessSpork(CNode *pfrom, const std::string &strCommand, CDataStream &vRecv, CConnman &connman)
ProcessSpork is used to handle the 'getsporks' and 'spork' p2p messages.
Definition: spork.cpp:114
Definition: box.hpp:161
Double ended buffer combining vector and stream-like interfaces.
Definition: streams.h:103
uint256 GetSignatureHash() const
GetSignatureHash returns the hash of the serialized spork message without the signature included...
Definition: spork.cpp:330
Sporks are network parameters used primarily to prevent forking and turn on/off certain features...
Definition: spork.h:75
std::string ToString() const
ToString returns the string representation of the SporkManager.
Definition: spork.cpp:319
Definition: spork.h:24
bool SetSporkAddress(const std::string &strAddress)
SetSporkAddress is used to set a public key ID which will be used to verify spork signatures...
Definition: spork.cpp:269
Definition: spork.h:32
std::unordered_map< SporkId, std::map< CKeyID, CSporkMessage > > mapSporksActive
Definition: spork.h:161
void CheckAndRemove()
CheckAndRemove is defined to fulfill an interface as part of the on-disk cache used to cache sporks b...
Definition: spork.cpp:69
Definition: spork.h:27
CSporkMessage(SporkId nSporkID, int64_t nValue, int64_t nTimeSigned)
Definition: spork.h:85
CSporkManager is a higher-level class which manages the node's spork messages, rules for which sporks...
Definition: spork.h:151
int64_t GetSporkValue(SporkId nSporkID)
GetSporkValue returns the spork value given a Spork ID.
Definition: spork.cpp:217
bool GetSporkByHash(const uint256 &hash, CSporkMessage &sporkRet)
GetSporkByHash returns a spork message given a hash of the spork message.
Definition: spork.cpp:255
std::string GetSporkNameByID(SporkId nSporkID)
GetSporkNameByID returns the spork name as a string, given a Spork ID.
Definition: spork.cpp:245
void SerializationOp(Stream &s, Operation ser_action)
Definition: spork.h:101
static const std::string SERIALIZATION_VERSION_STRING
Definition: spork.h:154
Definition: spork.h:26
uint256 GetHash() const
GetHash returns the double-sha256 hash of the serialized spork message.
Definition: spork.cpp:325
void SerializationOp(Stream &s, Operation ser_action)
Definition: spork.h:180
Definition: spork.h:25
std::unordered_map< uint256, CSporkMessage > mapSporksByHash
Definition: spork.h:160
bool GetSignerKeyID(CKeyID &retKeyidSporkSigner)
GetSignerKeyID is used to recover the spork address of the key used to sign this spork message...
Definition: spork.cpp:403
void Relay(CConnman &connman)
Relay is used to send this spork message to other peers.
Definition: spork.cpp:425
bool CheckSignature(const CKeyID &pubKeyId) const
CheckSignature will ensure the spork signature matches the provided public key hash.
Definition: spork.cpp:379
std::unordered_map< std::string, CSporkDef * > sporkDefsByName
Definition: spork.h:157
bool SporkValueIsActive(SporkId nSporkID, int64_t &nActiveValueRet) const
SporkValueIsActive is used to get the value agreed upon by the majority of signed spork messages for ...
Definition: spork.cpp:39
bool IsSporkActive(SporkId nSporkID)
IsSporkActive returns a bool for time-based sporks, and should be used to determine whether the spork...
Definition: spork.cpp:211
Definition: spork.h:30
bool SetMinSporkKeys(int minSporkKeys)
SetMinSporkKeys is used to set the required spork signer threshold, for a spork to be considered acti...
Definition: spork.cpp:281
Definition: spork.h:47
bool SetPrivKey(const std::string &strPrivKey)
SetPrivKey is used to set a spork key to enable setting / signing of spork values.
Definition: spork.cpp:292
Wrapped mutex: supports recursive locking, but no waiting TODO: We should move away from using the re...
Definition: sync.h:94
std::unordered_map< SporkId, CSporkDef * > sporkDefsById
Definition: spork.h:156
Definition: spork.h:29