Skip to content

Commit 7e871ab

Browse files
add nodiscard
Signed-off-by: pasta <[email protected]>
1 parent 56d67ac commit 7e871ab

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/coinjoin/client.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ class CPendingDsaRequest
5353
{
5454
}
5555

56-
CService GetAddr() const { return addr; }
57-
CCoinJoinAccept GetDSA() const { return dsa; }
58-
bool IsExpired() const { return GetTime() - nTimeCreated > TIMEOUT; }
56+
[[nodiscard]] CService GetAddr() const { return addr; }
57+
[[nodiscard]] CCoinJoinAccept GetDSA() const { return dsa; }
58+
[[nodiscard]] bool IsExpired() const { return GetTime() - nTimeCreated > TIMEOUT; }
5959

6060
friend bool operator==(const CPendingDsaRequest& a, const CPendingDsaRequest& b)
6161
{

src/coinjoin/coinjoin.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ class CCoinJoinQueue
247247
*/
248248
bool Sign();
249249
/// Check if we have a valid Masternode address
250-
bool CheckSignature(const CBLSPublicKey& blsPubKey) const;
250+
[[nodiscard]] bool CheckSignature(const CBLSPublicKey& blsPubKey) const;
251251

252252
bool Relay(CConnman& connman);
253253

254254
/// Check if a queue is too old or too far into the future
255-
bool IsTimeOutOfBounds() const;
255+
[[nodiscard]] bool IsTimeOutOfBounds() const;
256256

257-
std::string ToString() const
257+
[[nodiscard]] std::string ToString() const
258258
{
259259
return strprintf("nDenom=%d, nTime=%lld, fReady=%s, fTried=%s, masternode=%s",
260260
nDenom, nTime, fReady ? "true" : "false", fTried ? "true" : "false", masternodeOutpoint.ToStringShort());
@@ -321,14 +321,14 @@ class CCoinJoinBroadcastTx
321321
return *this != CCoinJoinBroadcastTx();
322322
}
323323

324-
uint256 GetSignatureHash() const;
324+
[[nodiscard]] uint256 GetSignatureHash() const;
325325

326326
bool Sign();
327-
bool CheckSignature(const CBLSPublicKey& blsPubKey) const;
327+
[[nodiscard]] bool CheckSignature(const CBLSPublicKey& blsPubKey) const;
328328

329329
void SetConfirmedHeight(int nConfirmedHeightIn) { nConfirmedHeight = nConfirmedHeightIn; }
330330
bool IsExpired(const CBlockIndex* pindex) const;
331-
bool IsValidStructure() const;
331+
[[nodiscard]] bool IsValidStructure() const;
332332
};
333333

334334
// base class

src/spork.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ class CSporkMessage
114114
/**
115115
* GetHash returns the double-sha256 hash of the serialized spork message.
116116
*/
117-
uint256 GetHash() const;
117+
[[nodiscard]] uint256 GetHash() const;
118118

119119
/**
120120
* GetSignatureHash returns the hash of the serialized spork message
121121
* without the signature included. The intent of this method is to get the
122122
* hash to be signed.
123123
*/
124-
uint256 GetSignatureHash() const;
124+
[[nodiscard]] uint256 GetSignatureHash() const;
125125

126126
/**
127127
* Sign will sign the spork message with the given key.
@@ -132,7 +132,7 @@ class CSporkMessage
132132
* CheckSignature will ensure the spork signature matches the provided public
133133
* key hash.
134134
*/
135-
bool CheckSignature(const CKeyID& pubKeyId) const;
135+
[[nodiscard]] bool CheckSignature(const CKeyID& pubKeyId) const;
136136

137137
/**
138138
* GetSignerKeyID is used to recover the spork address of the key used to

0 commit comments

Comments
 (0)