mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
refactor: use explicit std::shared_ptr instead of type alias (#4720)
This commit is contained in:
parent
52ddf5c453
commit
515011aaa8
@ -445,7 +445,7 @@ void CDeterministicMNList::AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTota
|
||||
}
|
||||
}
|
||||
|
||||
void CDeterministicMNList::UpdateMN(const CDeterministicMN& oldDmn, const CDeterministicMNStateCPtr& pdmnState)
|
||||
void CDeterministicMNList::UpdateMN(const CDeterministicMN& oldDmn, const std::shared_ptr<const CDeterministicMNState>& pdmnState)
|
||||
{
|
||||
auto dmn = std::make_shared<CDeterministicMN>(oldDmn);
|
||||
auto oldState = dmn->pdmnState;
|
||||
@ -474,7 +474,7 @@ void CDeterministicMNList::UpdateMN(const CDeterministicMN& oldDmn, const CDeter
|
||||
mnMap = mnMap.set(oldDmn.proTxHash, dmn);
|
||||
}
|
||||
|
||||
void CDeterministicMNList::UpdateMN(const uint256& proTxHash, const CDeterministicMNStateCPtr& pdmnState)
|
||||
void CDeterministicMNList::UpdateMN(const uint256& proTxHash, const std::shared_ptr<const CDeterministicMNState>& pdmnState)
|
||||
{
|
||||
auto oldDmn = mnMap.find(proTxHash);
|
||||
if (!oldDmn) {
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
uint256 proTxHash;
|
||||
COutPoint collateralOutpoint;
|
||||
uint16_t nOperatorReward{0};
|
||||
CDeterministicMNStateCPtr pdmnState;
|
||||
std::shared_ptr<const CDeterministicMNState> pdmnState;
|
||||
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, bool oldFormat)
|
||||
@ -340,8 +340,8 @@ public:
|
||||
CDeterministicMNList ApplyDiff(const CBlockIndex* pindex, const CDeterministicMNListDiff& diff) const;
|
||||
|
||||
void AddMN(const CDeterministicMNCPtr& dmn, bool fBumpTotalCount = true);
|
||||
void UpdateMN(const CDeterministicMN& oldDmn, const CDeterministicMNStateCPtr& pdmnState);
|
||||
void UpdateMN(const uint256& proTxHash, const CDeterministicMNStateCPtr& pdmnState);
|
||||
void UpdateMN(const CDeterministicMN& oldDmn, const std::shared_ptr<const CDeterministicMNState>& pdmnState);
|
||||
void UpdateMN(const uint256& proTxHash, const std::shared_ptr<const CDeterministicMNState>& pdmnState);
|
||||
void UpdateMN(const CDeterministicMN& oldDmn, const CDeterministicMNStateDiff& stateDiff);
|
||||
void RemoveMN(const uint256& proTxHash);
|
||||
|
||||
@ -482,7 +482,7 @@ public:
|
||||
uint256 blockHash;
|
||||
int nHeight{-1};
|
||||
std::map<uint256, CDeterministicMNCPtr> addedMNs;
|
||||
std::map<uint256, CDeterministicMNStateCPtr> updatedMNs;
|
||||
std::map<uint256, std::shared_ptr<const CDeterministicMNState>> updatedMNs;
|
||||
std::set<uint256> removedMns;
|
||||
|
||||
template<typename Stream>
|
||||
|
@ -20,9 +20,6 @@ class UniValue;
|
||||
|
||||
class CDeterministicMNState;
|
||||
|
||||
using CDeterministicMNStatePtr = std::shared_ptr<CDeterministicMNState>;
|
||||
using CDeterministicMNStateCPtr = std::shared_ptr<const CDeterministicMNState>;
|
||||
|
||||
namespace llmq
|
||||
{
|
||||
class CFinalCommitment;
|
||||
@ -131,8 +128,6 @@ public:
|
||||
std::string ToString() const;
|
||||
void ToJson(UniValue& obj) const;
|
||||
};
|
||||
using CDeterministicMNStatePtr = std::shared_ptr<CDeterministicMNState>;
|
||||
using CDeterministicMNStateCPtr = std::shared_ptr<const CDeterministicMNState>;
|
||||
|
||||
class CDeterministicMNStateDiff
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user