diff --git a/p2p/transport_memory.go b/p2p/transport_memory.go index b47ff6919..96a948ce1 100644 --- a/p2p/transport_memory.go +++ b/p2p/transport_memory.go @@ -135,6 +135,16 @@ func newMemoryTransport( } } +// String displays the transport. +// +// FIXME: The Transport interface should either have Name() or embed +// fmt.Stringer. This is necessary since we log the transport (to know which one +// it is), and if it doesn't implement fmt.Stringer then it inspects all struct +// contents via reflect, which triggers the race detector. +func (t *MemoryTransport) String() string { + return "memory" +} + // Accept implements Transport. func (t *MemoryTransport) Accept(ctx context.Context) (Connection, error) { select {