transaction: don't hide decoding error by logging

Unknown transaction types are wrong and should be treated as errors.
This commit is contained in:
Roman Khimov 2019-11-27 13:12:04 +03:00
parent 080b236275
commit 65bf0d01d5

View file

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