]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/node.go
Download link for 8.0.0 release
[nncp.git] / src / node.go
index f5bea183cce561b972dc009f4d440a0479082d0e..aabf8477535f831cd7da681f2f7ea3dd01f65820 100644 (file)
@@ -20,6 +20,7 @@ package nncp
 import (
        "crypto/rand"
        "errors"
+       "fmt"
        "sync"
        "time"
 
@@ -29,6 +30,8 @@ import (
        "golang.org/x/crypto/nacl/box"
 )
 
+const DummyB32Id = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+
 type NodeId [blake2b.Size256]byte
 
 func (id NodeId) String() string {
@@ -114,7 +117,7 @@ func (nodeOur *NodeOur) Their() *Node {
 func NodeIdFromString(raw string) (*NodeId, error) {
        decoded, err := Base32Codec.DecodeString(raw)
        if err != nil {
-               return nil, err
+               return nil, fmt.Errorf("Can not parse node: %s: %s", raw, err)
        }
        if len(decoded) != blake2b.Size256 {
                return nil, errors.New("Invalid node id size")