Merge pull request #522 from nspcc-dev/fix-invalid-tx-type-handling

Fix invalid tx type handling
This commit is contained in:
Vsevolod 2019-11-27 13:40:52 +03:00 committed by GitHub
commit 1a9e98caf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,10 +1,11 @@
package transaction package transaction
import ( import (
"fmt"
"github.com/CityOfZion/neo-go/pkg/crypto/hash" "github.com/CityOfZion/neo-go/pkg/crypto/hash"
"github.com/CityOfZion/neo-go/pkg/io" "github.com/CityOfZion/neo-go/pkg/io"
"github.com/CityOfZion/neo-go/pkg/util" "github.com/CityOfZion/neo-go/pkg/util"
log "github.com/sirupsen/logrus"
) )
const ( const (
@ -137,7 +138,7 @@ func (t *Transaction) decodeData(r *io.BinReader) {
t.Data = &StateTX{} t.Data = &StateTX{}
t.Data.(*StateTX).DecodeBinary(r) t.Data.(*StateTX).DecodeBinary(r)
default: default:
log.Warnf("invalid TX type %s", t.Type) r.Err = fmt.Errorf("invalid TX type %x", t.Type)
} }
} }