gnunet-go

GNUnet Bindings for Go
Log | Files | Refs | README | LICENSE

commit 7bfc54a066e5a2c65f43ef17783fc9b3abbfbef0
parent 7e13256995f3af254d8637a9eb44a2702c6ef541
Author: Bernd Fix <brf@hoi-polloi.org>
Date:   Sat, 15 Feb 2020 18:19:34 +0100

Adjusted LEHO coexist rules to spec.

Diffstat:
Msrc/gnunet/service/gns/block_handler.go | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/gnunet/service/gns/block_handler.go b/src/gnunet/service/gns/block_handler.go @@ -460,14 +460,8 @@ func (h *LehoHandler) AddRecord(rec *message.GNSResourceRecord, labels []string) // Coexist return a flag indicating how a resource record of a given type // is to be treated (see BlockHandler interface) func (h *LehoHandler) Coexist(cm util.CounterMap) bool { - // requires exactly one A/AAAA record alongside single LEHO - if len(cm) != 2 { - return false - } - if cm.Num(enums.GNS_TYPE_LEHO) != 1 { - return false - } - return (cm.Num(enums.GNS_TYPE_DNS_A) + cm.Num(enums.GNS_TYPE_DNS_AAAA)) > 1 + // requires exactly one LEHO and any number of other records. + return cm.Num(enums.GNS_TYPE_LEHO) == 1 } // Records returns a list of RR of the given type associated with this handler