cleanup unused code

This commit is contained in:
Arceliar 2021-05-29 20:42:06 -05:00
parent 180654c495
commit e25ad9ed21
5 changed files with 0 additions and 180 deletions

View file

@ -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
}

View file

@ -61,12 +61,6 @@ func (p *protoHandler) handleProto(from phony.Actor, key keyArray, bs []byte) {
}
}
func (p *protoHandler) handleDebug(from phony.Actor, key keyArray, bs []byte) {
p.Act(from, func() {
p._handleDebug(key, bs)
})
}
func (p *protoHandler) _handleDebug(key keyArray, bs []byte) {
if len(bs) == 0 {
return