mirror of
https://github.com/markqvist/LXMF.git
synced 2025-05-21 23:40:27 -04:00
Added base code for stamp generation and validation
This commit is contained in:
parent
4dca031441
commit
fe14f8744d
2 changed files with 88 additions and 13 deletions
|
@ -13,6 +13,12 @@ def delivery_callback(message):
|
|||
if message.unverified_reason == LXMF.LXMessage.SOURCE_UNKNOWN:
|
||||
signature_string = "Cannot verify, source is unknown"
|
||||
|
||||
stamp_cost = 12
|
||||
if message.validate_stamp(stamp_cost):
|
||||
stamp_string = "Valid"
|
||||
else:
|
||||
stamp_string = "Not valid"
|
||||
|
||||
RNS.log("\t+--- LXMF Delivery ---------------------------------------------")
|
||||
RNS.log("\t| Source hash : "+RNS.prettyhexrep(message.source_hash))
|
||||
RNS.log("\t| Source instance : "+str(message.get_source()))
|
||||
|
@ -24,6 +30,7 @@ def delivery_callback(message):
|
|||
RNS.log("\t| Content : "+message.content_as_string())
|
||||
RNS.log("\t| Fields : "+str(message.fields))
|
||||
RNS.log("\t| Message signature : "+signature_string)
|
||||
RNS.log("\t| Stamp : "+stamp_string)
|
||||
RNS.log("\t+---------------------------------------------------------------")
|
||||
|
||||
r = RNS.Reticulum()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue