mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
oops
This commit is contained in:
parent
34cc92678b
commit
21fa1969a4
4 changed files with 2 additions and 4 deletions
|
@ -7,7 +7,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/lbryio/reflector.go/dht/bits"
|
"github.com/lbryio/reflector.go/dht/bits"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
@ -14,7 +14,6 @@ import (
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
"github.com/lyoshenka/bencode"
|
"github.com/lyoshenka/bencode"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// packet represents the information receive from udp.
|
// packet represents the information receive from udp.
|
||||||
|
|
|
@ -13,8 +13,6 @@ import (
|
||||||
"github.com/lbryio/lbry.go/errors"
|
"github.com/lbryio/lbry.go/errors"
|
||||||
"github.com/lbryio/lbry.go/stop"
|
"github.com/lbryio/lbry.go/stop"
|
||||||
"github.com/lbryio/reflector.go/dht/bits"
|
"github.com/lbryio/reflector.go/dht/bits"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: if routing table is ever empty (aka the node is isolated), it should re-bootstrap
|
// TODO: if routing table is ever empty (aka the node is isolated), it should re-bootstrap
|
||||||
|
|
|
@ -32,6 +32,8 @@ func newTokenCache(node *Node, expiration time.Duration) *tokenCache {
|
||||||
return tc
|
return tc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: if store fails, get new token. can happen if a node restarts but we have the token cached
|
||||||
|
|
||||||
func (tc *tokenCache) Get(c Contact, hash bits.Bitmap, cancelCh stop.Chan) string {
|
func (tc *tokenCache) Get(c Contact, hash bits.Bitmap, cancelCh stop.Chan) string {
|
||||||
tc.lock.RLock()
|
tc.lock.RLock()
|
||||||
token, exists := tc.tokens[c.String()]
|
token, exists := tc.tokens[c.String()]
|
||||||
|
|
Loading…
Add table
Reference in a new issue