propose collation called if addr from sample is coinbase

Former-commit-id: 95d9c92597ded3ddb607370f43702122c44b5f56 [formerly f19f1fd28b1f8d44b27e054cfccf39b37110149a]
Former-commit-id: 1364ac025a86fd1b489255646efeb0b09c1c3cb0
This commit is contained in:
Raul Jordan
2018-02-01 18:01:21 -06:00
parent ec5e19f77c
commit ed6e77b24f

View File

@@ -60,9 +60,21 @@ func watchShards(c *Client, head *types.Header) error {
s := 0
for s < int(count.Int64()) {
// Checks if we are an eligible proposer according to the VMC
log.Info(fmt.Sprintf("shard %d", s))
addr, err := c.vmc.VMCCaller.Sample(&ops, big.NewInt(s))
if err != nil {
return err
}
// if the address is the coinbase addr (current node running the sharding
// clint, then we propose a new collation)
if addr == accounts[0].Address {
proposeCollation()
}
s++
}
return nil
}
func proposeCollation() {
return nil
}