We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5bc789 commit c113e3bCopy full SHA for c113e3b
p2p/config.go
@@ -18,6 +18,7 @@ package p2p
18
19
import (
20
"crypto/ecdsa"
21
+ "encoding"
22
"fmt"
23
24
"github.com/ethereum/go-ethereum/common/mclock"
@@ -135,6 +136,13 @@ type configNAT struct {
135
136
nat.Interface
137
}
138
139
+func (w *configNAT) MarshalText() ([]byte, error) {
140
+ if tm, ok := w.Interface.(encoding.TextMarshaler); ok {
141
+ return tm.MarshalText()
142
+ }
143
+ return nil, fmt.Errorf("NAT specification %#v cannot be marshaled", w.Interface)
144
+}
145
+
146
func (w *configNAT) UnmarshalText(input []byte) error {
147
n, err := nat.Parse(string(input))
148
if err != nil {
0 commit comments