]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/node.go
No triple password query
[nncp.git] / src / node.go
index e93b8d9c6565ba74954b11a3b6d7efb8f72efc7b..c965796ead59c38de3c774ef6968d41fe66a3c12 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -32,7 +32,7 @@ import (
 type NodeId [blake2b.Size256]byte
 
 func (id NodeId) String() string {
-       return ToBase32(id[:])
+       return Base32Codec.EncodeToString(id[:])
 }
 
 type Node struct {
@@ -51,7 +51,7 @@ type Node struct {
        Addrs          map[string]string
        RxRate         int
        TxRate         int
-       OnlineDeadline uint
+       OnlineDeadline time.Duration
        MaxOnlineTime  time.Duration
        Calls          []*Call
 
@@ -112,7 +112,7 @@ func (nodeOur *NodeOur) Their() *Node {
 }
 
 func NodeIdFromString(raw string) (*NodeId, error) {
-       decoded, err := FromBase32(raw)
+       decoded, err := Base32Codec.DecodeString(raw)
        if err != nil {
                return nil, err
        }