minor rlp things

This commit is contained in:
obscuren
2014-08-01 10:21:43 +02:00
parent 5a2d62e4d9
commit 5ede1224e4
3 changed files with 14 additions and 16 deletions

View File

@ -221,12 +221,15 @@ func (val *Value) Encode() []byte {
func (self *Value) Decode() {
v, _ := Decode(self.Bytes(), 0)
self.Val = v
//self.Val = DecodeWithReader(bytes.NewBuffer(self.Bytes()))
}
func NewValueFromBytes(data []byte) *Value {
if len(data) != 0 {
data, _ := Decode(data, 0)
return NewValue(data)
value := NewValue(data)
value.Decode()
return value
}
return NewValue(nil)