pull/583/merge
FujiCoin 2021-03-22 06:42:55 +09:00 committed by GitHub
commit 5bfc6680bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 8 deletions

View File

@ -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)