try_decrypt: do not use gossip_key if public_key is available

public_key is updated with apply_header in try_decrypt right above this
code, so it makes no sense to allow signing messages with gossip key.
This commit is contained in:
Alexander Krotov
2020-08-13 23:04:02 +03:00
committed by holger krekel
parent 8f7f4f95e8
commit 0bf8017e8f

View File

@@ -166,11 +166,10 @@ pub async fn try_decrypt(
}
if let Some(peerstate) = peerstate {
peerstate.handle_fingerprint_change(context).await?;
if let Some(key) = peerstate.gossip_key {
public_keyring_for_validate.add(key);
}
if let Some(key) = peerstate.public_key {
public_keyring_for_validate.add(key);
} else if let Some(key) = peerstate.gossip_key {
public_keyring_for_validate.add(key);
}
}