Commit b28c6d9
committed
fix(mpc): return error instead of panic when publicKey is nil in BroadcastPublicKey
registerReadyPairs spawns a goroutine that calls triggerECDHExchange ->
BroadcastPublicKey. If the peer restarts between scheduling and the
goroutine reading the local publicKey, e.publicKey is nil and
crypto/ecdh.(*PublicKey).Bytes panics with 'invalid memory address or
nil pointer dereference', killing the goroutine and forcing a
container restart+rejoin cycle of ~10-15s per occurrence.
Nil-check the receiver and e.publicKey at the top of BroadcastPublicKey
and return a descriptive error so the caller's ECDH retrigger logic
takes over instead of a panic propagating to stderr.
Refs fystack/mpcium issue 158.
Signed-off-by: SAY-5 <say.apm35@gmail.com>1 parent cafc7e4 commit b28c6d9
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
155 | 162 | | |
156 | 163 | | |
157 | 164 | | |
| |||
0 commit comments