Skip to content

Commit 479c50e

Browse files
less debug
1 parent 0086d3d commit 479c50e

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

internal_filesystem/lib/secp256k1.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
EC_UNCOMPRESSED = lib.SECP256K1_EC_UNCOMPRESSED
99

1010
HAS_RECOVERABLE = hasattr(lib, 'secp256k1_ecdsa_sign_recoverable')
11-
#HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign')
12-
HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign_custom') # forgot why it's called custom
11+
HAS_SCHNORR = hasattr(lib, 'secp256k1_schnorrsig_sign')
1312
HAS_ECDH = hasattr(lib, 'secp256k1_ecdh')
1413
HAS_EXTRAKEYS = hasattr(lib, 'secp256k1_keypair_create')
1514

@@ -232,17 +231,13 @@ def ecdsa_verify(self, msg, raw_sig, raw=False, digest=hashlib.sha256):
232231
return bool(verified)
233232

234233
def schnorr_verify(self, msg, schnorr_sig, bip340tag, raw=False):
235-
print("schnorr_verify 0")
236234
assert self.public_key, "No public key defined"
237235
if not HAS_SCHNORR:
238236
raise Exception("secp256k1_schnorr not enabled")
239-
print("schnorr_verify 1")
240237
msg_to_sign = _bip340_tag(msg, raw, bip340tag)
241-
print("schnorr_verify 2")
242238
verified = lib.secp256k1_schnorrsig_verify(
243239
secp256k1_ctx, schnorr_sig, msg_to_sign, len(msg_to_sign),
244240
self.xonly_pubkey)
245-
print("schnorr_verify 3")
246241
return bool(verified)
247242

248243
def ecdh(self, scalar, hashfn=ffi.NULL, hasharg=ffi.NULL):
@@ -366,7 +361,7 @@ def schnorr_sign(self, msg, bip340tag, raw=False):
366361
sig64 = ffi.new('char [64]')
367362

368363
# FIXME: It's recommended to provide aux_rand32...
369-
signed = lib.secp256k1_schnorrsig_sign_custom(
364+
signed = lib.secp256k1_schnorrsig_sign(
370365
secp256k1_ctx, sig64, msg_to_sign, len(msg_to_sign),
371366
self.keypair, ffi.NULL)
372367
assert signed == 1

internal_filesystem/lib/secp256k1_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def secp256k1_ecdsa_recover(self, ctx, pubkey, recover_sig, msg32):
252252
except (ValueError, AttributeError):
253253
return 0
254254

255-
def secp256k1_schnorrsig_sign_custom(self, ctx, sig64, msg, msg_len, keypair, aux_rand32):
255+
def secp256k1_schnorrsig_sign(self, ctx, sig64, msg, msg_len, keypair, aux_rand32):
256256
try:
257257
if isinstance(keypair, FFI.CData):
258258
keypair = keypair._data

internal_filesystem/lib/websocket_nostr_receive.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ def printevents():
5959
# allowing 30 seconds for stuff to come in...
6060
for _ in range(30):
6161
time.sleep(1)
62-
print(".")
62+
print("checking pool....")
6363
try:
6464
event_msg = relay_manager.message_pool.get_event()
6565
print(f"event_msg: pubkey: {event_msg.event.public_key} created_at {event_msg.event.created_at}")
6666
except Exception as e:
67-
print(f"pool.get_event() got error: {e}")
67+
#print(f"pool.get_event() got error: {e}")
68+
pass
6869
print("30 seconds passed, closing:")
6970
relay_manager.close_connections()
7071

0 commit comments

Comments
 (0)