@@ -211,7 +211,7 @@ impl BlockInfo {
211
211
212
212
/// Mark this block as valid, signed over, and records a group timestamp in the block info if it wasn't
213
213
/// already set.
214
- pub fn mark_globally_accepted ( & mut self ) -> Result < ( ) , String > {
214
+ fn mark_globally_accepted ( & mut self ) -> Result < ( ) , String > {
215
215
self . move_to ( BlockState :: GloballyAccepted ) ?;
216
216
self . valid = Some ( true ) ;
217
217
self . signed_over = true ;
@@ -227,7 +227,7 @@ impl BlockInfo {
227
227
}
228
228
229
229
/// Mark the block as globally rejected and invalid
230
- pub fn mark_globally_rejected ( & mut self ) -> Result < ( ) , String > {
230
+ fn mark_globally_rejected ( & mut self ) -> Result < ( ) , String > {
231
231
self . move_to ( BlockState :: GloballyRejected ) ?;
232
232
self . valid = Some ( false ) ;
233
233
Ok ( ( ) )
@@ -1134,6 +1134,24 @@ impl SignerDb {
1134
1134
) ;
1135
1135
tenure_extend_timestamp
1136
1136
}
1137
+
1138
+ /// Mark a block as globally accepted
1139
+ pub fn mark_block_globally_accepted ( & self , block_info : & mut BlockInfo ) -> Result < ( ) , DBError > {
1140
+ block_info
1141
+ . mark_globally_accepted ( )
1142
+ . map_err ( DBError :: Other ) ?;
1143
+ self . remove_pending_block_validation ( & block_info. signer_signature_hash ( ) ) ?;
1144
+ Ok ( ( ) )
1145
+ }
1146
+
1147
+ /// Mark a block as globally rejected
1148
+ pub fn mark_block_globally_rejected ( & self , block_info : & mut BlockInfo ) -> Result < ( ) , DBError > {
1149
+ block_info
1150
+ . mark_globally_rejected ( )
1151
+ . map_err ( DBError :: Other ) ?;
1152
+ self . remove_pending_block_validation ( & block_info. signer_signature_hash ( ) ) ?;
1153
+ Ok ( ( ) )
1154
+ }
1137
1155
}
1138
1156
1139
1157
fn try_deserialize < T > ( s : Option < String > ) -> Result < Option < T > , DBError >
0 commit comments