forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclsig.cpp
More file actions
33 lines (25 loc) · 903 Bytes
/
clsig.cpp
File metadata and controls
33 lines (25 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright (c) 2021-2025 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <chainlock/clsig.h>
#include <tinyformat.h>
#include <string_view>
namespace chainlock {
static constexpr std::string_view CLSIG_REQUESTID_PREFIX{"clsig"};
ChainLockSig::ChainLockSig() = default;
ChainLockSig::~ChainLockSig() = default;
ChainLockSig::ChainLockSig(int32_t nHeight, const uint256& blockHash, const CBLSSignature& sig) :
nHeight{nHeight},
blockHash{blockHash},
sig{sig}
{
}
std::string ChainLockSig::ToString() const
{
return strprintf("ChainLockSig(nHeight=%d, blockHash=%s)", nHeight, blockHash.ToString());
}
uint256 GenSigRequestId(const int32_t nHeight)
{
return ::SerializeHash(std::make_pair(CLSIG_REQUESTID_PREFIX, nHeight));
}
} // namespace chainlock