|
|
@ -2,6 +2,7 @@ package identitychain |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
"math" |
|
|
|
"net" |
|
|
|
"net" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"sync" |
|
|
|
"sync" |
|
|
@ -52,6 +53,7 @@ func (IDC *IdentityChain) SelectIds() { |
|
|
|
selectNumber := IDC.NumberOfNodesInShard - len(IDC.Identities) |
|
|
|
selectNumber := IDC.NumberOfNodesInShard - len(IDC.Identities) |
|
|
|
IB := IDC.GetLatestBlock() |
|
|
|
IB := IDC.GetLatestBlock() |
|
|
|
currentIDS := IB.GetIdentities() |
|
|
|
currentIDS := IB.GetIdentities() |
|
|
|
|
|
|
|
selectNumber = int(math.Min(float64(len(IDC.PendingIdentities)), float64(selectNumber))) |
|
|
|
pending := IDC.PendingIdentities[:selectNumber] |
|
|
|
pending := IDC.PendingIdentities[:selectNumber] |
|
|
|
IDC.SelectedIdentitites = append(currentIDS, pending...) |
|
|
|
IDC.SelectedIdentitites = append(currentIDS, pending...) |
|
|
|
IDC.PendingIdentities = []*waitnode.WaitNode{} |
|
|
|
IDC.PendingIdentities = []*waitnode.WaitNode{} |
|
|
|