Skip to content

Commit 417b065

Browse files
committed
Add missing OffersMessageHandler::best_block updating
It seems we forgot to ensure `OffersMessageHandler::best_block` is consistently updated, leading to us building invalid blinded payment paths for short-lived payment paths after two weeks without restart.
1 parent 2637b38 commit 417b065

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lightning/src/offers/flow.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,12 @@ impl<MR: MessageRouter, L: Logger> OffersMessageFlow<MR, L> {
183183
///
184184
/// Must be called whenever a new chain tip becomes available. May be skipped
185185
/// for intermediary blocks.
186-
pub fn best_block_updated(&self, header: &Header, _height: u32) {
186+
pub fn best_block_updated(&self, header: &Header, height: u32) {
187187
let timestamp = &self.highest_seen_timestamp;
188188
let block_time = header.time as usize;
189189

190+
*self.best_block.write().unwrap() = BestBlock::new(header.block_hash(), height);
191+
190192
loop {
191193
// Update timestamp to be the max of its current value and the block
192194
// timestamp. This should keep us close to the current time without relying on

0 commit comments

Comments
 (0)