@@ -42,7 +42,7 @@ func IncludePredecisions(
4242 state .Predecided = true
4343
4444 // Sign predecision attaching mc.Self to prevent replay attacks
45- cryptopbdsl .SignRequest (m , mc .Crypto , & cryptopbtypes.SignedData {[][]byte {data , []byte (mc .Self )}}, & signRequest {data })
45+ cryptopbdsl .SignRequest (m , mc .Crypto , & cryptopbtypes.SignedData {Data : [][]byte {data , []byte (mc .Self )}}, & signRequest {data : data })
4646
4747 return nil
4848 })
@@ -69,7 +69,7 @@ func IncludePredecisions(
6969
7070 // Verify signature of received signed predecision
7171 cryptopbdsl .VerifySig (m , mc .Crypto ,
72- & cryptopbtypes.SignedData {[][]byte {predecision , []byte (mc .Self )}},
72+ & cryptopbtypes.SignedData {Data : [][]byte {predecision , []byte (mc .Self )}},
7373 signature ,
7474 from ,
7575 & accpbtypes.SignedPredecision {
@@ -80,7 +80,8 @@ func IncludePredecisions(
8080 })
8181
8282 cryptopbdsl .UponSigVerified (m , func (nodeId t.NodeID , err error , sp * accpbtypes.SignedPredecision ) error {
83- return ApplySigVerified (m , mc , params , state , nodeId , err , sp , true , logger )
83+ ApplySigVerified (m , mc , params , state , nodeId , err , sp , true , logger )
84+ return nil
8485 })
8586
8687}
@@ -94,27 +95,26 @@ func ApplySigVerified(
9495 mc * common.ModuleConfig ,
9596 params * common.ModuleParams ,
9697 state * incommon.State ,
97- nodeId t.NodeID ,
98+ nodeID t.NodeID ,
9899 err error ,
99100 sp * accpbtypes.SignedPredecision ,
100101 flushPoMs bool ,
101102 logger logging.Logger ,
102- ) error {
103+ ) {
103104 if err != nil {
104105 logger .Log (logging .LevelDebug , "Signature verification failed" )
105- return nil
106106 }
107107
108108 // Check if PoM found
109- if state .SignedPredecisions [nodeId ] != nil {
110- if ! reflect .DeepEqual (state .SignedPredecisions [nodeId ].Predecision , sp .Predecision ) {
109+ if state .SignedPredecisions [nodeID ] != nil {
110+ if ! reflect .DeepEqual (state .SignedPredecisions [nodeID ].Predecision , sp .Predecision ) {
111111 logger .Log (logging .LevelWarn , "Received conflicting signed predecisions from same node" )
112112 // if a PoM for this node has not already been sent
113- if _ , ok := state .SentPoMs [nodeId ]; ! ok {
113+ if _ , ok := state .SentPoMs [nodeID ]; ! ok {
114114 state .UnsentPoMs = append (state .UnsentPoMs ,
115115 & accpbtypes.PoM {
116- NodeId : nodeId ,
117- ConflictingMsg_1 : state .SignedPredecisions [nodeId ],
116+ NodeId : nodeID ,
117+ ConflictingMsg_1 : state .SignedPredecisions [nodeID ],
118118 ConflictingMsg_2 : sp ,
119119 })
120120
@@ -124,16 +124,15 @@ func ApplySigVerified(
124124 }
125125
126126 logger .Log (logging .LevelDebug , "Discarding signed predecision as already received one from same node" )
127- return nil
128127 }
129128 }
130129
131130 // Store signed predecision
132- state .SignedPredecisions [nodeId ] = sp
131+ state .SignedPredecisions [nodeID ] = sp
133132 if state .PredecisionCount [string (sp .Predecision )] == nil {
134133 state .PredecisionCount [string (sp .Predecision )] = make ([]t.NodeID , 0 )
135134 }
136- state .PredecisionCount [string (sp .Predecision )] = append (state .PredecisionCount [string (sp .Predecision )], nodeId )
135+ state .PredecisionCount [string (sp .Predecision )] = append (state .PredecisionCount [string (sp .Predecision )], nodeID )
137136
138137 // Once verified, if strong quorum, broadcast accpbdsl.FullCertificate
139138 if state .DecidedCertificate == nil &&
@@ -165,8 +164,6 @@ func ApplySigVerified(
165164 maputil .GetKeys (params .Membership .Nodes ))
166165 }
167166 }
168-
169- return nil
170167}
171168
172169type signRequest struct {
0 commit comments