Merge 048fc369e0
into 1f6cddd4ab
commit
5bfc6680bc
|
@ -4,6 +4,7 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"unicode/utf8"
|
||||||
"math/big"
|
"math/big"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
@ -160,14 +161,7 @@ func (p *BitcoinParser) TryParseOPReturn(script []byte) string {
|
||||||
return ed
|
return ed
|
||||||
}
|
}
|
||||||
|
|
||||||
isASCII := true
|
if utf8.Valid(data) {
|
||||||
for _, c := range data {
|
|
||||||
if c < 32 || c > 127 {
|
|
||||||
isASCII = false
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if isASCII {
|
|
||||||
ed = "(" + string(data) + ")"
|
ed = "(" + string(data) + ")"
|
||||||
} else {
|
} else {
|
||||||
ed = hex.EncodeToString(data)
|
ed = hex.EncodeToString(data)
|
||||||
|
|
Loading…
Reference in New Issue