Set UDP flags correctly.

This commit is contained in:
Jeffrey Picard 2021-11-24 19:14:52 -05:00
parent 283686ecac
commit 1c1d288654

View file

@ -16,6 +16,9 @@ const maxBufferSize = 1024
// genesis blocktime (which is actually wrong)
const magic = 1446058291
const protocolVersion = 1
const defaultFlags = 0b00000000
var availableFlag = 0b00000001
// SPVPing is a struct for the format of how to ping another hub over udp.
// format b'!lB64s'
@ -241,7 +244,7 @@ func UDPServer(args *Args) error {
}
sAddr := addr.IP.String()
pong := makeSPVPong(0, 0, tip, sAddr, args.Country)
pong := makeSPVPong(defaultFlags|availableFlag, 0, tip, sAddr, args.Country)
data := pong.Encode()
_, err = conn.WriteToUDP(data, addr)