aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-18 08:34:06 +0800
committerobscuren <geffobscura@gmail.com>2014-02-18 08:34:06 +0800
commitd7eca7bcc12e940f0aa80d45e6e802ba68143b5c (patch)
tree0ca5ae2019fccbb15b326d8cf4cad365a205d4eb /ethutil
parent68028f492f092f0546c2c084c1694ee6bf43b34e (diff)
downloadgo-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar.gz
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar.bz2
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar.lz
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar.xz
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.tar.zst
go-tangerine-d7eca7bcc12e940f0aa80d45e6e802ba68143b5c.zip
Rlp update
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/encoding.go3
-rw-r--r--ethutil/rlp.go8
2 files changed, 1 insertions, 10 deletions
diff --git a/ethutil/encoding.go b/ethutil/encoding.go
index 207548c93..1f661947a 100644
--- a/ethutil/encoding.go
+++ b/ethutil/encoding.go
@@ -3,7 +3,6 @@ package ethutil
import (
"bytes"
"encoding/hex"
- _ "fmt"
"strings"
)
@@ -36,7 +35,7 @@ func CompactEncode(hexSlice []int) string {
func CompactDecode(str string) []int {
base := CompactHexDecode(str)
base = base[:len(base)-1]
- if base[0] >= 2 { // && base[len(base)-1] != 16 {
+ if base[0] >= 2 {
base = append(base, 16)
}
if base[0]%2 == 1 {
diff --git a/ethutil/rlp.go b/ethutil/rlp.go
index 025d269a0..e633f5f1d 100644
--- a/ethutil/rlp.go
+++ b/ethutil/rlp.go
@@ -86,13 +86,6 @@ func DecodeWithReader(reader *bytes.Buffer) interface{} {
// TODO Use a bytes.Buffer instead of a raw byte slice.
// Cleaner code, and use draining instead of seeking the next bytes to read
func Decode(data []byte, pos uint64) (interface{}, uint64) {
- /*
- if pos > uint64(len(data)-1) {
- log.Println(data)
- log.Panicf("index out of range %d for data %q, l = %d", pos, data, len(data))
- }
- */
-
var slice []interface{}
char := int(data[pos])
switch {
@@ -131,7 +124,6 @@ func Decode(data []byte, pos uint64) (interface{}, uint64) {
case char <= 0xff:
l := uint64(data[pos]) - 0xf7
- //b := BigD(data[pos+1 : pos+1+l]).Uint64()
b := ReadVarint(bytes.NewReader(data[pos+1 : pos+1+l]))
pos = pos + l + 1