[staking] Remove legacy code (#1679)

pull/1681/head
Edgar Aroutiounian 5 years ago committed by GitHub
parent dac42117ee
commit 06289ed130
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      api/proto/common.go
  2. 7
      node/node_handler.go

@ -31,7 +31,6 @@ const (
Node
Client
DRand
Staking
// TODO: add more types
)
@ -105,10 +104,3 @@ func ConstructDRandMessage(payload []byte) []byte {
byteBuffer.Write(payload)
return byteBuffer.Bytes()
}
// ConstructStakingMessage creates a message with the payload and returns as byte array.
func ConstructStakingMessage(payload []byte) []byte {
byteBuffer := bytes.NewBuffer([]byte{byte(Staking)})
byteBuffer.Write(payload)
return byteBuffer.Bytes()
}

@ -140,13 +140,6 @@ func (node *Node) messageHandler(content []byte, sender libp2p_peer.ID) {
node.DRand.ProcessMessageValidator(msgPayload)
}
}
case proto.Staking:
utils.Logger().Debug().Msg("NET: Received staking message")
msgPayload, _ := proto.GetStakingMessagePayload(content)
// Only beacon leader processes staking txn
if node.Consensus != nil && node.Consensus.ShardID == 0 && node.Consensus.IsLeader() {
node.processStakingMessage(msgPayload)
}
case proto.Node:
actionType := proto_node.MessageType(msgType)
switch actionType {

Loading…
Cancel
Save