mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-30 07:05:06 +03:00
cleanup unused code
This commit is contained in:
parent
180654c495
commit
e25ad9ed21
5 changed files with 0 additions and 180 deletions
|
@ -27,23 +27,11 @@ type nodeinfo struct {
|
|||
callbacks map[keyArray]nodeinfoCallback
|
||||
}
|
||||
|
||||
type nodeinfoCached struct {
|
||||
payload NodeInfoPayload
|
||||
created time.Time
|
||||
}
|
||||
|
||||
type nodeinfoCallback struct {
|
||||
call func(nodeinfo NodeInfoPayload)
|
||||
created time.Time
|
||||
}
|
||||
|
||||
// Represents a session nodeinfo packet.
|
||||
type nodeinfoReqRes struct {
|
||||
Key keyArray // Sender's permanent key
|
||||
IsResponse bool
|
||||
NodeInfo NodeInfoPayload
|
||||
}
|
||||
|
||||
// Initialises the nodeinfo cache/callback maps, and starts a goroutine to keep
|
||||
// the cache/callback maps clean of stale entries
|
||||
func (m *nodeinfo) init(proto *protoHandler) {
|
||||
|
@ -69,13 +57,6 @@ func (m *nodeinfo) _cleanup() {
|
|||
})
|
||||
}
|
||||
|
||||
// Add a callback for a nodeinfo lookup
|
||||
func (m *nodeinfo) addCallback(sender keyArray, call func(nodeinfo NodeInfoPayload)) {
|
||||
m.Act(nil, func() {
|
||||
m._addCallback(sender, call)
|
||||
})
|
||||
}
|
||||
|
||||
func (m *nodeinfo) _addCallback(sender keyArray, call func(nodeinfo NodeInfoPayload)) {
|
||||
m.callbacks[sender] = nodeinfoCallback{
|
||||
created: time.Now(),
|
||||
|
@ -91,14 +72,6 @@ func (m *nodeinfo) _callback(sender keyArray, nodeinfo NodeInfoPayload) {
|
|||
}
|
||||
}
|
||||
|
||||
// Get the current node's nodeinfo
|
||||
func (m *nodeinfo) getNodeInfo() (p NodeInfoPayload) {
|
||||
phony.Block(m, func() {
|
||||
p = m._getNodeInfo()
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
func (m *nodeinfo) _getNodeInfo() NodeInfoPayload {
|
||||
return m.myNodeInfo
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue