|
|
@ -43,6 +43,13 @@ func (IDC *IdentityChain) IdentityChainHandler(conn net.Conn) { |
|
|
|
actionType := proto_identity.IdentityMessageType(msgType) |
|
|
|
actionType := proto_identity.IdentityMessageType(msgType) |
|
|
|
switch actionType { |
|
|
|
switch actionType { |
|
|
|
case proto_identity.IDENTITY: |
|
|
|
case proto_identity.IDENTITY: |
|
|
|
|
|
|
|
IDC.registerIdentity(msgPayload) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (IDC *IdentityChain) registerIdentity(msgPayload []byte) { |
|
|
|
identityPayload, err := proto_identity.GetIdentityMessagePayload(msgPayload) |
|
|
|
identityPayload, err := proto_identity.GetIdentityMessagePayload(msgPayload) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
IDC.log.Error("identity payload not read") |
|
|
|
IDC.log.Error("identity payload not read") |
|
|
@ -52,7 +59,4 @@ func (IDC *IdentityChain) IdentityChainHandler(conn net.Conn) { |
|
|
|
NewWaitNode := waitnode.DeserializeWaitNode(identityPayload) |
|
|
|
NewWaitNode := waitnode.DeserializeWaitNode(identityPayload) |
|
|
|
IDC.PendingIdentities = append(IDC.PendingIdentities, NewWaitNode) |
|
|
|
IDC.PendingIdentities = append(IDC.PendingIdentities, NewWaitNode) |
|
|
|
fmt.Println(len(IDC.PendingIdentities)) |
|
|
|
fmt.Println(len(IDC.PendingIdentities)) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|