diff --git a/consensus/pre_prepare_pool.go b/consensus/pre_prepare_pool.go index ce7f3b7..1c4642f 100644 --- a/consensus/pre_prepare_pool.go +++ b/consensus/pre_prepare_pool.go @@ -174,8 +174,14 @@ func (ppp *PrePreparePool) IsValidPrePrepare(prePrepare *types2.Message) bool { } } - if err = sigs.Verify(msg.Signature, msg.Message.From.Bytes(), msg.Message.Cid().Bytes()); err != nil { - logrus.Errorf("Couldn't verify transaction %v", err) + if msg.Type = ftypes.MessageTypeSecp256k1 { + if err = sigs.Verify(msg.Signature, msg.Message.From.Bytes(), msg.Message.Cid().Bytes()); err != nil { + logrus.Errorf("Couldn't verify transaction %v", err) + } + return true + } else { + // TODO: BLS Signature verification + return true } } ///////////////////////////////// diff --git a/rpc/filecoin/filecoin.go b/rpc/filecoin/filecoin.go index b4dcb70..5ad85e6 100644 --- a/rpc/filecoin/filecoin.go +++ b/rpc/filecoin/filecoin.go @@ -15,11 +15,6 @@ import ( var filecoinURL = "https://api.node.glif.io/" -const ( - blsType = 0x1 - secp256k1Type = 0x2 -) - // client implements the `Client` interface. type LotusClient struct { host string @@ -86,9 +81,9 @@ func (c *LotusClient) GetTransaction(cid string) ([]byte, error) { switch msg.Message.From.Protocol() | msg.Message.To.Protocol() { case address.BLS: - msg.Type = blsType + msg.Type = ftypes.MessageTypeBLS case address.SECP256K1: - msg.Type = secp256k1Type + msg.Type = ftypes.MessageTypeSecp256k1 default: return nil, fmt.Errorf("Address has unsupported protocol %v", err) }