PIVX Core  5.6.99
P2P Digital Currency
masternode_meta_manager.cpp
Go to the documentation of this file.
1 // Copyright (c) 2014-2021 The Dash Core developers
2 // Copyright (c) 2021 The PIVX Core developers
3 // Distributed under the X11 software license, see the accompanying
4 // file COPYING or https://www.opensource.org/licenses/mit-license.php.
5 
7 #include <sstream>
8 
10 
11 const std::string CMasternodeMetaMan::SERIALIZATION_VERSION_STRING = "CMasternodeMetaMan-Version-2";
12 
14 {
16  auto it = metaInfos.find(proTxHash);
17  if (it != metaInfos.end()) {
18  return it->second;
19  }
20  if (!fCreate) {
21  return nullptr;
22  }
23  it = metaInfos.emplace(proTxHash, std::make_shared<CMasternodeMetaInfo>(proTxHash)).first;
24  return it->second;
25 }
26 
27 
29 {
31  metaInfos.clear();
32 }
33 
35 {
37  std::ostringstream info;
38 
39  info << "Masternodes: meta infos object count: " << (int)metaInfos.size();
40  return info.str();
41 }
static const std::string SERIALIZATION_VERSION_STRING
std::map< uint256, CMasternodeMetaInfoPtr > metaInfos
CMasternodeMetaInfoPtr GetMetaInfo(const uint256 &proTxHash, bool fCreate=true)
256-bit opaque blob.
Definition: uint256.h:138
@ LOCK
Definition: lockunlock.h:16
CMasternodeMetaMan g_mmetaman
std::shared_ptr< CMasternodeMetaInfo > CMasternodeMetaInfoPtr
@ proTxHash
Definition: rpcevo.cpp:50