Skip to content

Commit 6040de9

Browse files
committed
Add comments on CPubKey::IsValid
1 parent 8dbb7de commit 6040de9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/pubkey.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ class CPubKey
170170
/*
171171
* Check syntactic correctness.
172172
*
173+
* When setting a pubkey (Set()) or deserializing fails (its header bytes
174+
* don't match the length of the data), the size is set to 0. Thus,
175+
* by checking size, one can observe whether Set() or deserialization has
176+
* failed.
177+
*
178+
* This does not check for more than that. In particular, it does not verify
179+
* that the coordinates correspond to a point on the curve (see IsFullyValid()
180+
* for that instead).
181+
*
173182
* Note that this is consensus critical as CheckECDSASignature() calls it!
174183
*/
175184
bool IsValid() const

0 commit comments

Comments
 (0)