@@ -1065,6 +1065,7 @@ impl CollatorStdImpl {
1065
1065
let mut last_anchor = None ;
1066
1066
let mut all_anchors_are_taken_from_cache = false ;
1067
1067
let mut processed_to_anchor_exists_in_cache = false ;
1068
+ let mut total_our_exts_count: usize = 0 ;
1068
1069
1069
1070
// we count our messages for processed_to with existing offset
1070
1071
let mut offset = processed_to_msgs_offset as usize ;
@@ -1100,6 +1101,7 @@ impl CollatorStdImpl {
1100
1101
1101
1102
// and keep others
1102
1103
let our_exts_count = anchor. count_externals_for ( & shard_id, offset) ;
1104
+ total_our_exts_count = total_our_exts_count. saturating_add ( our_exts_count) ;
1103
1105
anchors_info. push ( InitAnchorSource :: FromCache ( AnchorInfo :: from_anchor (
1104
1106
anchor. clone ( ) ,
1105
1107
our_exts_count,
@@ -1122,6 +1124,7 @@ impl CollatorStdImpl {
1122
1124
) ) ) ;
1123
1125
} ;
1124
1126
anchors_cache. set_last_imported_anchor_info ( anchor_info. clone ( ) ) ;
1127
+ anchors_cache. set_has_pending_externals ( total_our_exts_count > 0 ) ;
1125
1128
1126
1129
return Ok ( anchors_info) ;
1127
1130
}
@@ -1159,6 +1162,7 @@ impl CollatorStdImpl {
1159
1162
// add loaded anchor to cache
1160
1163
if let Some ( anchor) = next_anchor {
1161
1164
let our_exts_count = anchor. count_externals_for ( & shard_id, offset) ;
1165
+ total_our_exts_count = total_our_exts_count. saturating_add ( our_exts_count) ;
1162
1166
anchors_cache. insert ( anchor. clone ( ) , our_exts_count) ;
1163
1167
anchors_info. push ( InitAnchorSource :: Imported ( AnchorInfo :: from_anchor (
1164
1168
anchor,
@@ -1193,6 +1197,8 @@ impl CollatorStdImpl {
1193
1197
next_anchor = Some ( anchor) ;
1194
1198
}
1195
1199
1200
+ anchors_cache. set_has_pending_externals ( total_our_exts_count > 0 ) ;
1201
+
1196
1202
Ok ( anchors_info)
1197
1203
}
1198
1204
0 commit comments