Every message type apart from KE goes through the following check in AcceptMessage to ensure only one message of each type per identity per session:
|
// Check that a message from this identity does not conflict with a |
|
// different message of the same type in the session. |
|
var haveKE bool |
|
for _, prevHash := range p.messagesByIdentity[*id] { |
|
e := p.pool[prevHash] |
|
if e.msgtype == msgtype && bytes.Equal(e.msg.Sid(), msg.Sid()) { |
|
return nil, ruleError(fmt.Errorf("message %v by identity %x "+ |
|
"in session %x conflicts with already accepted message %v", |
|
hash, *id, msg.Sid(), prevHash)) |
|
} |
|
if !haveKE && e.msgtype == msgtypeKE && bytes.Equal(e.msg.Sid(), msg.Sid()) { |
|
haveKE = true |
|
} |
|
} |
Not applying this check to KE messages means there is no upper bound on how many KE messages can be sent by a single peer and an unlimited number of these messages will be cached in memory.
Every message type apart from KE goes through the following check in
AcceptMessageto ensure only one message of each type per identity per session:dcrd/mixing/mixpool/mixpool.go
Lines 1302 to 1315 in 3836103
Not applying this check to KE messages means there is no upper bound on how many KE messages can be sent by a single peer and an unlimited number of these messages will be cached in memory.