more hardening

This commit is contained in:
Riccardo Balbo 2025-02-23 16:51:26 +00:00
commit ac69ae9846
3 changed files with 18 additions and 4 deletions

View file

@ -144,4 +144,12 @@ def assert_valid_bolt11(invoice:str):
if not ENABLE_HARDENING:
return
assert_printable(invoice)
# Check if boolean
def assert_boolean(v:bool):
if not ENABLE_HARDENING:
return
if not isinstance(v, bool):
panic("not a boolean")