consensus: set preparation hash in recovery message
This commit is contained in:
parent
7c900edd2d
commit
b649ffb88e
1 changed files with 7 additions and 0 deletions
|
@ -136,11 +136,18 @@ func (m *recoveryMessage) AddPayload(p payload.ConsensusPayload) {
|
|||
switch p.Type() {
|
||||
case payload.PrepareRequestType:
|
||||
m.prepareRequest = p.GetPrepareRequest().(*prepareRequest)
|
||||
h := p.Hash()
|
||||
m.preparationHash = &h
|
||||
case payload.PrepareResponseType:
|
||||
m.preparationPayloads = append(m.preparationPayloads, &preparationCompact{
|
||||
ValidatorIndex: p.ValidatorIndex(),
|
||||
InvocationScript: p.(*Payload).Witness.InvocationScript,
|
||||
})
|
||||
|
||||
if m.preparationHash == nil {
|
||||
h := p.GetPrepareResponse().PreparationHash()
|
||||
m.preparationHash = &h
|
||||
}
|
||||
case payload.ChangeViewType:
|
||||
m.changeViewPayloads = append(m.changeViewPayloads, &changeViewCompact{
|
||||
ValidatorIndex: p.ValidatorIndex(),
|
||||
|
|
Loading…
Reference in a new issue