mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Fix relay submitting extra parachain headers during reorg (#2839)
* fix on-demand parachain relay behavior during target chain reorgs * fix compilation
This commit is contained in:
committed by
Bastian Köcher
parent
acfd2847b4
commit
f24e8f008a
@@ -120,10 +120,15 @@ where
|
||||
// `max_header_id` is not set. There is no limit.
|
||||
AvailableHeader::Available(on_chain_para_head_id)
|
||||
},
|
||||
AvailableHeader::Available(max_head_id) => {
|
||||
AvailableHeader::Available(max_head_id) if on_chain_para_head_id >= max_head_id => {
|
||||
// We report at most `max_header_id`.
|
||||
AvailableHeader::Available(std::cmp::min(on_chain_para_head_id, max_head_id))
|
||||
},
|
||||
AvailableHeader::Available(_) => {
|
||||
// the `max_head_id` is not yet available at the source chain => wait and avoid
|
||||
// syncing extra headers
|
||||
AvailableHeader::Unavailable
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user