diff --git a/.goreleaser.yml b/.goreleaser.yml index cb3bc6e..b8bfff4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -8,11 +8,11 @@ builds: - id: dashmsg-default main: ./cmd/dashmsg/ env: - - CGO_ENABLED=1 + - CGO_ENABLED=0 goos: - darwin - #- linux - #- windows + - linux + - windows goarch: - amd64 - arm64 diff --git a/dashmsg.go b/dashmsg.go index 8d2a33a..87e00f2 100644 --- a/dashmsg.go +++ b/dashmsg.go @@ -184,10 +184,12 @@ func DoubleHash(buf []byte) []byte { } // EncodeToBCVarint is a special variable-width byte encoding for 8, 16, 32, or 64-bit integers. For integers less than 253 bytes it uses a single bit. 253, 254, and 255 signify a 16, 32, and 64-bit (2, 4, and 8-byte) little-endian encodings respectively. -func EncodeToBCVarint(n int) []byte { +func EncodeToBCVarint(m int) []byte { // See https://wiki.bitcoinsv.io/index.php/VarInt var buf []byte + n := int64(m) + if n < 253 { buf = make([]byte, 1) buf[0] = byte(n)