forked from TrueCloudLab/neoneo-go
network: plug in dBFT library
This commit is contained in:
parent
5ad665bc37
commit
fdd5276d3e
29 changed files with 1415 additions and 142 deletions
|
@ -1,18 +1,29 @@
|
|||
package consensus
|
||||
|
||||
import "github.com/CityOfZion/neo-go/pkg/io"
|
||||
import (
|
||||
"github.com/CityOfZion/neo-go/pkg/io"
|
||||
"github.com/nspcc-dev/dbft/payload"
|
||||
)
|
||||
|
||||
// recoveryRequest represents dBFT RecoveryRequest message.
|
||||
type recoveryRequest struct {
|
||||
Timestamp uint32
|
||||
timestamp uint32
|
||||
}
|
||||
|
||||
var _ payload.RecoveryRequest = (*recoveryRequest)(nil)
|
||||
|
||||
// DecodeBinary implements io.Serializable interface.
|
||||
func (m *recoveryRequest) DecodeBinary(r *io.BinReader) {
|
||||
r.ReadLE(&m.Timestamp)
|
||||
r.ReadLE(&m.timestamp)
|
||||
}
|
||||
|
||||
// EncodeBinary implements io.Serializable interface.
|
||||
func (m *recoveryRequest) EncodeBinary(w *io.BinWriter) {
|
||||
w.WriteLE(m.Timestamp)
|
||||
w.WriteLE(m.timestamp)
|
||||
}
|
||||
|
||||
// Timestamp implements payload.RecoveryRequest interface.
|
||||
func (m *recoveryRequest) Timestamp() uint32 { return m.timestamp }
|
||||
|
||||
// SetTimestamp implements payload.RecoveryRequest interface.
|
||||
func (m *recoveryRequest) SetTimestamp(ts uint32) { m.timestamp = ts }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue