tordam

A library for peer discovery inside the Tor network
git clone https://git.parazyd.org/tordam
Log | Files | Refs | README | LICENSE

commit 7934583b6b6cd475c6a06d3ed576079cfb8c3bda
parent 49372b5d4c62690ea9d63f568f3b28596e5a8e86
Author: parazyd <parazyd@dyne.org>
Date:   Thu,  1 Nov 2018 13:59:29 +0100

Apply some linting to dam-client.

Diffstat:
Mcmd/dam-client/main.go | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go @@ -143,10 +143,7 @@ func fetchNodeList(epLists []string, noremote bool) ([]string, error) { } func announce(node string, vals map[string]string, privkey ed25519.PrivateKey) (bool, error) { - msg, err := json.Marshal(vals) - if err != nil { - return false, err - } + msg, _ := json.Marshal(vals) log.Println("Announcing keypair to:", node) resp, err := lib.HTTPPost("http://"+node+"/announce", msg) @@ -179,10 +176,7 @@ func announce(node string, vals map[string]string, privkey ed25519.PrivateKey) ( vals["message"] = m.Secret vals["signature"] = encodedSig - msg, err := json.Marshal(vals) - if err != nil { - return false, err - } + msg, _ := json.Marshal(vals) log.Printf("%s: success. Sending back signed secret.\n", node) resp, err := lib.HTTPPost("http://"+node+"/announce", msg)