merge upstream

This commit is contained in:
zelig
2014-07-01 15:03:02 +01:00
71 changed files with 13647 additions and 141 deletions

View File

@ -14,6 +14,7 @@ type config struct {
ExecPath string
Debug bool
Paranoia bool
Ver string
ClientString string
Identifier string
@ -43,7 +44,7 @@ func ReadConfig(ConfigFile string, Datadir string, Identifier string, EnvPrefix
} else {
g.ParseAll()
}
Config = &config{ExecPath: Datadir, Debug: true, Ver: "0.5.15", conf: g, Identifier: Identifier}
Config = &config{ExecPath: Datadir, Debug: true, Ver: "0.5.15", conf: g, Identifier: Identifier, Paranoia: true}
Config.SetClientString("Ethereum(G)")
}
return Config

View File

@ -116,6 +116,8 @@ func (val *Value) Bytes() []byte {
return a
} else if s, ok := val.Val.(byte); ok {
return []byte{s}
} else if s, ok := val.Val.(string); ok {
return []byte(s)
}
return []byte{}
@ -196,6 +198,12 @@ func (val *Value) Encode() []byte {
return Encode(val.Val)
}
// Assume that the data we have is encoded
func (self *Value) Decode() {
v, _ := Decode(self.Bytes(), 0)
self.Val = v
}
func NewValueFromBytes(data []byte) *Value {
if len(data) != 0 {
data, _ := Decode(data, 0)