Unmarshal the SubmitBlock error.

The string needs to be unmarshaled rather than returned directly otherwise
it will have an extra set of quotes plus it's safter to properly unmarshal
it.

Pointed out by @jrick.
This commit is contained in:
Dave Collins 2014-06-26 21:47:29 -05:00
parent 0f6726b9c3
commit 894d5e23aa

View file

@ -375,9 +375,14 @@ func (r FutureSubmitBlockResult) Receive() error {
return err return err
} }
resStr := string(res) if string(res) != "null" {
if resStr != "null" { var result string
return errors.New(resStr) err = json.Unmarshal(res, &result)
if err != nil {
return err
}
return errors.New(result)
} }
return nil return nil