916: fix: do not discard messages with no payload r=fryorcraken a=fryorcraken

While they do not need to be decoded, they might still be used.
e.g. timestamp, network connectivity, etc.

Co-authored-by: fryorcraken.eth <git@fryorcraken.xyz>
This commit is contained in:
status-bors-ng[bot] 2022-08-31 04:23:38 +00:00 committed by GitHub
commit 9195f8fcf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -151,15 +151,11 @@ export class WakuMessage {
protoBuf: proto.WakuMessage,
decryptionParams?: DecryptionParams[]
): Promise<WakuMessage | undefined> {
if (protoBuf.payload === undefined) {
dbg("Payload is undefined");
return;
}
const payload = protoBuf.payload;
let signaturePublicKey;
let signature;
if (protoBuf.version === 1 && protoBuf.payload) {
if (protoBuf.version === 1 && payload) {
if (decryptionParams === undefined) {
dbg("Payload is encrypted but no private keys have been provided.");
return;