mirror of
https://github.com/btcsuite/btcd.git
synced 2026-08-13 12:32:51 +02:00
Golang's net package has been broken for android since android 11 and the node will not be able to call net.InterfaceAddr() without root. For android builds, we use anet so that the btcd node can be used without root.
25 lines
652 B
Go
25 lines
652 B
Go
// Copyright (c) 2025 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build android
|
|
// +build android
|
|
|
|
package btcutil
|
|
|
|
import (
|
|
"net"
|
|
|
|
"github.com/kcalvinalvin/anet"
|
|
)
|
|
|
|
// InterfaceAddrs returns a list of the system's network interface addresses.
|
|
// We specifically wrap anet.InterfaceAddrs as the net pakcage has been broken
|
|
// since android 11.
|
|
//
|
|
// The relevant github issue link is:
|
|
// https://github.com/golang/go/issues/40569.
|
|
// When the issue is later resolved, we should remove it.
|
|
func InterfaceAddrs() ([]net.Addr, error) {
|
|
return anet.InterfaceAddrs()
|
|
}
|