Add some simple accessors needed in NBC for the JSON-RPC service

This commit is contained in:
Zahary Karadjov 2020-03-17 18:58:11 +02:00
parent ab6a087d4d
commit b3b5854003
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
2 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
import
chronos, chronicles
proc catchOrQuit(error: Exception) =
proc catchOrQuit*(error: Exception) =
if error of CatchableError:
trace "Async operation ended with a recoverable error", err = error.msg
else:

View File

@ -68,6 +68,9 @@ proc newProtocol*(privKey: PrivateKey, db: Database,
result.routingTable.init(node)
func privKey*(p: Protocol): lent PrivateKey =
p.privateKey
proc send(d: Protocol, a: Address, data: seq[byte]) =
# debug "Sending bytes", amount = data.len, to = a
let ta = initTAddress(a.ip, a.udpPort)