Commit f387f59 1 parent 2b61774 commit f387f59 Copy full SHA for f387f59
File tree 1 file changed +8
-3
lines changed
packages/sdk/src/protocols/filter
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,7 @@ import { Logger } from "@waku/utils";
6
6
7
7
type ReceivedMessageHashes = {
8
8
all : Set < string > ;
9
- nodes : {
10
- [ peerId : PeerIdStr ] : Set < string > ;
11
- } ;
9
+ nodes : Record < PeerIdStr , Set < string > > ;
12
10
} ;
13
11
14
12
const DEFAULT_MAX_MISSED_MESSAGES_THRESHOLD = 3 ;
@@ -60,6 +58,13 @@ export class ReliabilityMonitor {
60
58
this . receivedMessagesHashes . all . add ( hashedMessageStr ) ;
61
59
62
60
if ( peerIdStr ) {
61
+ const x = this . receivedMessagesHashes . nodes [ peerIdStr ] ;
62
+ if ( ! x ) {
63
+ log . warn (
64
+ `Peer ${ peerIdStr } not initialized in receivedMessagesHashes.nodes, adding it.`
65
+ ) ;
66
+ this . receivedMessagesHashes . nodes [ peerIdStr ] = new Set ( ) ;
67
+ }
63
68
this . receivedMessagesHashes . nodes [ peerIdStr ] . add ( hashedMessageStr ) ;
64
69
}
65
70
You can’t perform that action at this time.
0 commit comments