mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-09 18:54:19 +00:00
Remove subscribe without handler as we don't provide another mechanism for retrieval of the messages
This commit is contained in:
parent
187bd22cc2
commit
83b956c042
@ -326,10 +326,10 @@ proc nimbus_subscribe_filter(options: ptr CFilterOptions,
|
||||
udata: pointer = nil, id: var Identifier): bool {.exportc.} =
|
||||
## Encryption is mandatory.
|
||||
## A symmetric key or an asymmetric key must be provided. Both is not allowed.
|
||||
## In case of a passed handler, the received msg needs to be copied before the
|
||||
## handler ends.
|
||||
## The received message needs to be copied before the passed handler ends.
|
||||
doAssert(not (unsafeAddr id).isNil, "Key id cannot be nil.")
|
||||
doAssert(not options.isNil, "Filter options pointer cannot be nil.")
|
||||
doAssert(not handler.isNil, "Filter handler cannot be nil." )
|
||||
|
||||
var
|
||||
src: Option[PublicKey]
|
||||
@ -364,10 +364,6 @@ proc nimbus_subscribe_filter(options: ptr CFilterOptions,
|
||||
let filter = newFilter(src, privateKey, symKey, @[options.topic],
|
||||
options.minPow, options.allowP2P)
|
||||
|
||||
if handler.isNil:
|
||||
# TODO: call can create `Exception`, why?
|
||||
hexToBytes(node.subscribeFilter(filter, nil), id)
|
||||
else:
|
||||
proc c_handler(msg: ReceivedMessage) {.gcsafe.} =
|
||||
var cmsg = CReceivedMessage(
|
||||
decoded: unsafeAddr msg.decoded.payload[0],
|
||||
|
Loading…
x
Reference in New Issue
Block a user