forked from bnb-chain/tss-lib
/
round_5_new_step_3.go
50 lines (39 loc) · 1.08 KB
/
round_5_new_step_3.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright © 2019 Binance
//
// This file is part of Binance. The full Binance copyright notice, including
// terms governing use, modification, and redistribution, is contained in the
// file LICENSE at the root of the source code distribution tree.
package resharing
import (
"errors"
"github.com/Aasifj2/tss-lib/tss"
)
func (round *round5) Start() *tss.Error {
if round.started {
return round.WrapError(errors.New("round already started"))
}
round.number = 5
round.started = true
round.allOldOK()
round.allNewOK()
if round.IsNewCommittee() {
// for this P: SAVE data
round.save.BigXj = round.temp.newBigXjs
round.save.ShareID = round.PartyID().KeyInt()
round.save.Xi = round.temp.newXi
round.save.Ks = round.temp.newKs
} else if round.IsOldCommittee() {
round.input.Xi.SetInt64(0)
}
round.end <- *round.save
return nil
}
func (round *round5) CanAccept(msg tss.ParsedMessage) bool {
return false
}
func (round *round5) Update() (bool, *tss.Error) {
return false, nil
}
func (round *round5) NextRound() tss.Round {
return nil // both committees are finished!
}