p2p: only allow ed25519 pubkeys when connecting

also, recover from any possible failures in acceptPeers

Refs #4030
This commit is contained in:
Anton Kaliaev
2019-10-10 09:01:51 -07:00
committed by Jack Zampolin
parent 0f111b3c5c
commit ab62fd977f
4 changed files with 81 additions and 9 deletions
+5
View File
@@ -21,6 +21,11 @@ func NewPubKeyMultisigThreshold(k int, pubkeys []crypto.PubKey) crypto.PubKey {
if len(pubkeys) < k {
panic("threshold k of n multisignature: len(pubkeys) < k")
}
for _, pubkey := range pubkeys {
if pubkey == nil {
panic("nil pubkey")
}
}
return PubKeyMultisigThreshold{uint(k), pubkeys}
}