Fix Nimbus Post implementation
This commit is contained in:
parent
d3de88f790
commit
cbe2d621f4
|
@ -181,7 +181,7 @@ func (w *nimbusPublicWhisperAPIWrapper) Post(ctx context.Context, req types.NewM
|
|||
defer C.free(unsafe.Pointer(symKeyID))
|
||||
}
|
||||
if req.PublicKey != nil && len(req.PublicKey) > 0 {
|
||||
msg.pubKey = (*C.uchar)(C.CBytes(req.PublicKey))
|
||||
msg.pubKey = (*C.uchar)(C.CBytes(req.PublicKey[1:]))
|
||||
defer C.free(unsafe.Pointer(msg.pubKey))
|
||||
}
|
||||
msg.payloadLen = C.size_t(len(req.Payload))
|
||||
|
|
|
@ -5,12 +5,11 @@ package nimbusbridge
|
|||
// https://golang.org/cmd/cgo/
|
||||
|
||||
/*
|
||||
#cgo LDFLAGS: -Wl,-rpath,'$ORIGIN' -L${SRCDIR} -lnimbus -lpcre -lm
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <libnimbus.h>
|
||||
void onMessageHandler_cgo(received_message * msg, void* udata); // Forward declaration.
|
||||
void onMessageHandler_cgo(received_message* msg, void* udata); // Forward declaration.
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
Loading…
Reference in New Issue