mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-22 12:47:51 +01:00
Add information request list to DHT structure. It keeps track of requests and matches responses.
Break up SendRequest into individual functions SendRequestStore and SendRequestFindNode, which improves readability. Alpha parameter must be now passed. MarkNodeAsSeen is exported. Breaking up dht.iterate and embedding into 3 functions Get, FindNode, and FindValue.
This commit is contained in:
@@ -127,10 +127,11 @@ func (n *shortList) GetUncontacted(count int, useCount bool) (Nodes []*Node) {
|
||||
|
||||
// NodeMessage is a message sent by a node
|
||||
type NodeMessage struct {
|
||||
SenderID []byte // Sender of this message
|
||||
Data []byte
|
||||
Closest []*Node
|
||||
Error error
|
||||
SenderID []byte // Sender of the message
|
||||
Data []byte // FIND_VALUE: Actual data
|
||||
Closest []*Node // FIND_VALUE, FIND_NODE: Closest nodes to the requested key
|
||||
Storing []*Node // FIND_VALUE: Nodes known to store the value
|
||||
Error error // To be removed
|
||||
}
|
||||
|
||||
// NodeFilterFunc is called to filter nodes based on the callers choice
|
||||
|
||||
Reference in New Issue
Block a user