it can't have a destination until one is filled

This commit is contained in:
idk
2019-07-03 22:09:29 -04:00
parent 98ddd74e32
commit 291b43dd4b
2 changed files with 7 additions and 4 deletions

View File

@ -101,9 +101,12 @@ func (c *Client) Base32() string {
}
func (c *Client) base64() []byte {
s, _ := i2pB64enc.DecodeString(c.destination)
alen := binary.BigEndian.Uint16(s[385:387])
return s[:387+alen]
if c.destination != "" {
s, _ := i2pB64enc.DecodeString(c.destination)
alen := binary.BigEndian.Uint16(s[385:387])
return s[:387+alen]
}
return []byte("")
}
// Base64 returns the base64 of the local tunnel

View File

@ -14,7 +14,6 @@ func setup(t *testing.T) {
if err != nil {
t.Fatalf("NewDefaultClient() Error: %q\n", err)
}
}
func teardown(t *testing.T) {
@ -25,5 +24,6 @@ func teardown(t *testing.T) {
func TestClientHello(t *testing.T) {
setup(t)
t.Log(client.Base32())
teardown(t)
}