@@ -1153,6 +1153,7 @@ impl Signer {
1153
1153
& mut self ,
1154
1154
stacks_client : & StacksClient ,
1155
1155
block_validate_ok : & BlockValidateOk ,
1156
+ sortition_state : & mut Option < SortitionsView > ,
1156
1157
) -> Option < BlockResponse > {
1157
1158
crate :: monitoring:: actions:: increment_block_validation_responses ( true ) ;
1158
1159
let signer_signature_hash = block_validate_ok. signer_signature_hash ;
@@ -1192,17 +1193,18 @@ impl Signer {
1192
1193
if let Some ( block_response) =
1193
1194
self . check_block_against_signer_db_state ( stacks_client, & block_info. block )
1194
1195
{
1196
+ let block_rejection = block_response. as_block_rejection ( ) ?;
1195
1197
// The signer db state has changed. We no longer view this block as valid. Override the validation response.
1196
1198
if let Err ( e) = block_info. mark_locally_rejected ( ) {
1197
1199
if !block_info. has_reached_consensus ( ) {
1198
1200
warn ! ( "{self}: Failed to mark block as locally rejected: {e:?}" ) ;
1199
1201
}
1200
1202
} ;
1201
- self . impl_send_block_response ( Some ( & block_info. block ) , block_response) ;
1202
1203
self . signer_db
1203
1204
. insert_block ( & block_info)
1204
1205
. unwrap_or_else ( |e| self . handle_insert_block_error ( e) ) ;
1205
- None
1206
+ self . handle_block_rejection ( block_rejection, sortition_state) ;
1207
+ Some ( block_response)
1206
1208
} else {
1207
1209
if let Err ( e) = block_info. mark_locally_accepted ( false ) {
1208
1210
if !block_info. has_reached_consensus ( ) {
@@ -1292,7 +1294,7 @@ impl Signer {
1292
1294
crate :: monitoring:: actions:: record_block_validation_latency (
1293
1295
block_validate_ok. validation_time_ms ,
1294
1296
) ;
1295
- self . handle_block_validate_ok ( stacks_client, block_validate_ok)
1297
+ self . handle_block_validate_ok ( stacks_client, block_validate_ok, sortition_state )
1296
1298
}
1297
1299
BlockValidateResponse :: Reject ( block_validate_reject) => {
1298
1300
self . handle_block_validate_reject ( block_validate_reject, sortition_state)
0 commit comments