X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=netsync%2Fconsensusmgr%2Fconsensus_msg.go;h=33fee3d197f5e00331fe108b45addd9f598b18c2;hp=40f74c79c498414ba14ac3892ca73d7a65b42d54;hb=669d176c004324fe81a26261a6e41ddea95b6f17;hpb=3605a69afbf9ff5b2bd091b3f5b6eac0d9cefa6f diff --git a/netsync/consensusmgr/consensus_msg.go b/netsync/consensusmgr/consensus_msg.go index 40f74c79..33fee3d1 100644 --- a/netsync/consensusmgr/consensus_msg.go +++ b/netsync/consensusmgr/consensus_msg.go @@ -46,19 +46,18 @@ func decodeMessage(bz []byte) (msgType byte, msg ConsensusMessage, err error) { // BlockSignatureMsg block signature message transferred between nodes. type BlockSignatureMsg struct { BlockHash [32]byte - Height uint64 Signature []byte - PubKey [64]byte + PubKey []byte } //NewBlockSignatureMsg create new block signature msg. -func NewBlockSignatureMsg(blockHash bc.Hash, height uint64, signature []byte, pubKey [64]byte) ConsensusMessage { +func NewBlockSignatureMsg(blockHash bc.Hash, signature, pubKey []byte) ConsensusMessage { hash := blockHash.Byte32() - return &BlockSignatureMsg{BlockHash: hash, Height: height, Signature: signature, PubKey: pubKey} + return &BlockSignatureMsg{BlockHash: hash, Signature: signature, PubKey: pubKey} } func (bs *BlockSignatureMsg) String() string { - return fmt.Sprintf("{block_hash: %s,block_height:%d,signature:%s,pubkey:%s}", hex.EncodeToString(bs.BlockHash[:]), bs.Height, hex.EncodeToString(bs.Signature), hex.EncodeToString(bs.PubKey[:])) + return fmt.Sprintf("{block_hash: %s,signature:%s,pubkey:%s}", hex.EncodeToString(bs.BlockHash[:]), hex.EncodeToString(bs.Signature), hex.EncodeToString(bs.PubKey[:])) } // BroadcastMarkSendRecord mark send message record to prevent messages from being sent repeatedly.