refactor: replace AnnounceHandler interface with Handler and update ReceivedAnnounce method to include hops parameter

This commit is contained in:
2025-12-31 18:42:50 -06:00
parent e6fd7188d2
commit d6152ccd85
4 changed files with 13 additions and 18 deletions

View File

@@ -335,12 +335,13 @@ func (h *genericAnnounceHandler) ReceivePathResponses() bool {
return false
}
func (h *genericAnnounceHandler) ReceivedAnnounce(destHash []byte, ident interface{}, appData []byte) error {
func (h *genericAnnounceHandler) ReceivedAnnounce(destHash []byte, ident interface{}, appData []byte, hops uint8) error {
if !announceHandler.IsUndefined() {
hashStr := hex.EncodeToString(destHash)
announceHandler.Invoke(js.ValueOf(map[string]interface{}{
"hash": hashStr,
"appData": string(appData),
"hops": int(hops),
}))
}
return nil