aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/bytes.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-18 19:19:03 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-18 19:19:03 +0800
commitfba6de834ec262313aba7c4f45b05fe6ff074e46 (patch)
treecf4facc4b61c7c70627e0dad537cdf0a0f79f5e8 /ethutil/bytes.go
parent22e16f15a69f53934a61978eb18fdf0244a74a99 (diff)
parent2fbcfd88249de8f55b7f06619d9003fadcc8e1e3 (diff)
downloaddexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.gz
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.bz2
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.lz
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.xz
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.tar.zst
dexon-fba6de834ec262313aba7c4f45b05fe6ff074e46.zip
Merge branch 'develop' of github.com:ethereum/eth-go into develop
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r--ethutil/bytes.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go
index bd0df68ec..5e3ee4a6f 100644
--- a/ethutil/bytes.go
+++ b/ethutil/bytes.go
@@ -5,6 +5,7 @@ import (
"encoding/binary"
"fmt"
"math/big"
+ "strings"
)
// Number to bytes
@@ -91,7 +92,7 @@ func IsHex(str string) bool {
}
func StringToByteFunc(str string, cb func(str string) []byte) (ret []byte) {
- if len(str) > 1 && str[0:2] == "0x" {
+ if len(str) > 1 && str[0:2] == "0x" && !strings.Contains(str, "\n") {
ret = FromHex(str[2:])
} else {
ret = cb(str)