nip77: more interface fixes to prevent channel deadlock.

This commit is contained in:
fiatjaf
2025-11-13 16:11:21 -03:00
parent e6dd124042
commit c20ca669cd
4 changed files with 50 additions and 62 deletions

View File

@@ -192,10 +192,12 @@ func (n *Negentropy) reconcileAux(reader *bytes.Reader) ([]byte, error) {
if _, theyHave := theirItems[item.ID]; theyHave {
// if we have and they have, ignore
delete(theirItems, item.ID)
} else if n.Haves != nil {
// if we have and they don't, notify client
if n.isClient {
n.Haves <- item.ID
} else {
if n.Haves != nil {
// if we have and they don't, notify client
if n.isClient {
n.Haves <- item.ID
}
}
}
}