forked from TrueCloudLab/neoneo-go
network: implement Consensus payloads
This commit is contained in:
parent
ad9091d13d
commit
085ca7b770
13 changed files with 806 additions and 3 deletions
22
pkg/consensus/commit.go
Normal file
22
pkg/consensus/commit.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package consensus
|
||||
|
||||
import "github.com/CityOfZion/neo-go/pkg/io"
|
||||
|
||||
// commit represents dBFT Commit message.
|
||||
type commit struct {
|
||||
Signature [signatureSize]byte
|
||||
}
|
||||
|
||||
// signatureSize is an rfc6989 signature size in bytes
|
||||
// without leading byte (0x04, uncompressed)
|
||||
const signatureSize = 64
|
||||
|
||||
// EncodeBinary implements io.Serializable interface.
|
||||
func (c *commit) EncodeBinary(w *io.BinWriter) {
|
||||
w.WriteBE(c.Signature)
|
||||
}
|
||||
|
||||
// DecodeBinary implements io.Serializable interface.
|
||||
func (c *commit) DecodeBinary(r *io.BinReader) {
|
||||
r.ReadBE(&c.Signature)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue