Skip to content

Commit

Permalink
Merge pull request #3 from qiwenmin/fix-wrong-addr
Browse files Browse the repository at this point in the history
Fix wrong address.
  • Loading branch information
eyedeekay authored Oct 18, 2020
2 parents 1ef2d90 + cd744bf commit 5a43ad2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions i2pkeys/I2PAddr.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ func NewI2PAddrFromBytes(addr []byte) (I2PAddr, error) {

// Turns an I2P address to a byte array. The inverse of NewI2PAddrFromBytes().
func (addr I2PAddr) ToBytes() ([]byte, error) {
buf := make([]byte, i2pB64enc.DecodedLen(len(addr)))
if _, err := i2pB64enc.Decode(buf, []byte(addr)); err != nil {
return buf, errors.New("Address is not base64-encoded")
}
return buf, nil
return i2pB64enc.DecodeString(string(addr))
}

func (addr I2PAddr) Bytes() []byte {
Expand Down

0 comments on commit 5a43ad2

Please sign in to comment.