diff --git a/accounts/abi/abi.go b/accounts/abi/abi.go index 0c88bfa855..c230cfb39e 100644 --- a/accounts/abi/abi.go +++ b/accounts/abi/abi.go @@ -126,8 +126,7 @@ func toGoSlice(i int, t Argument, output []byte) (interface{}, error) { // reslice to match the required size slice = slice[:(size * 32)] - } - if t.Type.IsArray { + } else if t.Type.IsArray { //get the number of elements in the array size = t.Type.SliceSize @@ -142,6 +141,7 @@ func toGoSlice(i int, t Argument, output []byte) (interface{}, error) { return nil, fmt.Errorf("abi: cannot marshal in to go slice: insufficient size output %d require %d", len(output), offset+32+size*32) } } + for i := 0; i < size; i++ { var ( inter interface{} // interface type diff --git a/accounts/abi/type.go b/accounts/abi/type.go index 5d014bee2c..39b843f817 100644 --- a/accounts/abi/type.go +++ b/accounts/abi/type.go @@ -180,8 +180,7 @@ func (t Type) pack(v reflect.Value) ([]byte, error) { } if t.IsSlice { return packBytesSlice(packed, v.Len()), nil - } - if t.IsArray { + } else if t.IsArray { return packed, nil } } diff --git a/node/node.go b/node/node.go index 41c9eb27f7..92f375ada9 100644 --- a/node/node.go +++ b/node/node.go @@ -248,7 +248,7 @@ func (n *Node) openDataDir() error { // Try to open the instance directory as LevelDB storage. This creates a lock file // which prevents concurrent use by another instance as well as accidental use of the // instance directory as a database. - storage, err := storage.OpenFile(instdir, true) + storage, err := storage.OpenFile(instdir) if err != nil { return err }