go-libp2p icon indicating copy to clipboard operation
go-libp2p copied to clipboard

fix: remove duplicate listen addresses to avoid muxer panic

Open derrandz opened this issue 5 months ago • 4 comments

Fixes this part of the issue: https://github.com/libp2p/go-libp2p/issues/3340#issuecomment-3103612088

derrandz avatar Jul 28 '25 21:07 derrandz

It is an error to try to Listen on the same address twice. This is probably not what you want.

MarcoPolo avatar Jul 28 '25 22:07 MarcoPolo

hmmmm, what should we do when passed two identical listen addresses? that muxer panic is very ambiguous. maybe we should handle this case? passing two addresses is a user bug ofc but it was disorientating enough to see that panic

derrandz avatar Jul 28 '25 22:07 derrandz

a better error would be a welcome change

MarcoPolo avatar Jul 28 '25 22:07 MarcoPolo

@MarcoPolo I went with a solution to simply ignore and discard duplicate listen addresses. Wdyt? or shall we return an error on validate?

derrandz avatar Jul 29 '25 21:07 derrandz