-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual DHT scaffold #570
Dual DHT scaffold #570
Conversation
I think we're good, actually. Go-ipfs can access what it needs by looking at the sub-DHTs directly. |
@willscott Do you want an additional review on this ? |
i wouldn't look too deeply at the parallel setups yet. i'll work on tests tomorrow and that'll get this code quite a bit cleaner. If you have comments on the interface / how it's interacting with the main DHT package, a glance wouldn't hurt. The main point of feedback from @Stebalien at this point is that the LAN dht shouldn't default to |
Do you mean: 1. If 2. If |
If the user has constructed the dht with an explicit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of small nits but looks good otherwise.
|
||
found := make(map[peer.ID]struct{}, count) | ||
var pi peer.AddrInfo | ||
for (zeroCount || count > 0) && (wanCh != nil || lanCh != nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fine, this is definitely cleaner than the way I fixed this...
if dht.activeWAN() { | ||
return dht.WAN.Provide(ctx, key, announce) | ||
} | ||
return dht.LAN.Provide(ctx, key, announce) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien @willscott I thought we were concerned about constantly providing/putting to people on our LANs. Did we decide that wasn't a big deal or am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this only does the puts/provides to the LAN-filtered DHT when there are no discovered peers in the WAN DHT routing table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right, I'm being silly didn't see the return
🤦
address #567