reduce redundant memory allocatio - resolves btcsuite/btcd#1699

Signed-off-by: Tomasz Ziolkowski <tomasz.ziolkowski@allegro.pl>
This commit is contained in:
Tomasz Ziolkowski 2021-10-15 16:56:27 +02:00 committed by Roy Lee
parent 40dab558f6
commit a8ad257660

View file

@ -76,7 +76,7 @@ func TorLookupIP(host, proxy string) ([]net.IP, error) {
return nil, ErrTorUnrecognizedAuthMethod
}
buf = make([]byte, 7+len(host))
buf = make([]byte, 6+len(host))
buf[0] = 5 // protocol version
buf[1] = '\xF0' // Tor Resolve
buf[2] = 0 // reserved