Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 38 additions & 22 deletions src/spv/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,28 +643,44 @@ impl SpvManager {

tokio::task::block_in_place(|| {
tokio::runtime::Handle::current().block_on(async {
interface
.get_quorum_by_height(core_chain_locked_height, llmq_type, qh)
.await
.map(|q| {
tracing::debug!(
"Quorum public key found: type={}, hash={}, height={}",
quorum_type,
hex::encode(quorum_hash),
core_chain_locked_height
);
*q.quorum_entry.quorum_public_key.as_ref()
})
.map_err(|e| {
tracing::warn!(
"Quorum lookup failed at height {} for llmq_type={} hash=0x{}: {}",
core_chain_locked_height,
quorum_type,
hex::encode(quorum_hash),
e
);
e.to_string()
})
tokio::time::timeout(
std::time::Duration::from_secs(30),
interface.get_quorum_by_height(core_chain_locked_height, llmq_type, qh),
)
.await
.map_err(|_| {
tracing::warn!(
"Quorum lookup timed out after 30s at height {} for llmq_type={} hash=0x{}",
core_chain_locked_height,
quorum_type,
hex::encode(quorum_hash),
);
format!(
"Quorum lookup timed out after 30s at height {} for llmq_type={} hash=0x{}",
core_chain_locked_height,
quorum_type,
hex::encode(quorum_hash),
)
})?
.map(|q| {
tracing::debug!(
"Quorum public key found: type={}, hash={}, height={}",
quorum_type,
hex::encode(quorum_hash),
core_chain_locked_height
);
*q.quorum_entry.quorum_public_key.as_ref()
})
.map_err(|e| {
tracing::warn!(
"Quorum lookup failed at height {} for llmq_type={} hash=0x{}: {}",
core_chain_locked_height,
quorum_type,
hex::encode(quorum_hash),
e
);
e.to_string()
})
})
})
}
Expand Down
Loading