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"
"encoding/binary"
"encoding/hex"
"unicode/utf8"
"math/big"
"strconv"
@ -160,14 +161,7 @@ func (p *BitcoinParser) TryParseOPReturn(script []byte) string {
return ed
}
isASCII := true
for _, c := range data {
if c < 32 || c > 127 {
isASCII = false
break
}
}
if isASCII {
if utf8.Valid(data) {
ed = "(" + string(data) + ")"
} else {
ed = hex.EncodeToString(data)