accounts/abi: fix if statements

Signed-off-by: VoR0220 <rj@erisindustries.com>
This commit is contained in:
VoR0220 2016-11-01 13:12:02 -05:00
parent b3e60b857a
commit 1ec212eeba
No known key found for this signature in database
GPG key ID: D4AB109D9B5D6386
3 changed files with 4 additions and 5 deletions

View file

@ -126,8 +126,7 @@ func toGoSlice(i int, t Argument, output []byte) (interface{}, error) {
// reslice to match the required size // reslice to match the required size
slice = slice[:(size * 32)] slice = slice[:(size * 32)]
} } else if t.Type.IsArray {
if t.Type.IsArray {
//get the number of elements in the array //get the number of elements in the array
size = t.Type.SliceSize 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) 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++ { for i := 0; i < size; i++ {
var ( var (
inter interface{} // interface type inter interface{} // interface type

View file

@ -180,8 +180,7 @@ func (t Type) pack(v reflect.Value) ([]byte, error) {
} }
if t.IsSlice { if t.IsSlice {
return packBytesSlice(packed, v.Len()), nil return packBytesSlice(packed, v.Len()), nil
} } else if t.IsArray {
if t.IsArray {
return packed, nil return packed, nil
} }
} }

View file

@ -248,7 +248,7 @@ func (n *Node) openDataDir() error {
// Try to open the instance directory as LevelDB storage. This creates a lock file // 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 // which prevents concurrent use by another instance as well as accidental use of the
// instance directory as a database. // instance directory as a database.
storage, err := storage.OpenFile(instdir, true) storage, err := storage.OpenFile(instdir)
if err != nil { if err != nil {
return err return err
} }