Skip to content

Commit 5a81fd9

Browse files
committed
Fix fail safe iteration when forming ECDSA point
The last byte of a pubkey of Class B transactions is iterated until a valid ECDSA point is formed. A valid point is usually right around the corner, but there is a fail safe included to avoid looping the last byte forever, in case there is none. The loop for this was faulty and is fixed now. Thanks to @lxjxiaojun for spotting this!
1 parent d945a38 commit 5a81fd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/omnicore/encoding.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool OmniCore_Encode_ClassB(const std::string& senderAddress, const CPubKey& red
5353
vchFakeKey.resize(33);
5454
CPubKey pubKey;
5555
unsigned char chRandom = static_cast<unsigned char>(GetRand(256));
56-
for (int j = 0; i < 256 ; j++) { // Fix ECDSA coodinate
56+
for (int j = 0; j < 256 ; j++) { // Fix ECDSA coodinate
5757
vchFakeKey[32] = chRandom;
5858
pubKey = CPubKey(vchFakeKey);
5959
if (pubKey.IsFullyValid()) break;

0 commit comments

Comments
 (0)