mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-23 00:21:38 +03:00
eth: manually unsubscribe if we break remote_subscription due to error
This commit is contained in:
parent
81fa748d0a
commit
19a750b5e5
@ -470,7 +470,7 @@ async fn maintain_remote_subscription(
|
||||
true,
|
||||
Some(30),
|
||||
IncomingReq::SubKeepalive(remote_sub_id),
|
||||
&send_to_loop,
|
||||
send_to_loop,
|
||||
).await;
|
||||
}
|
||||
_incoming = net_error_rx.recv() => {
|
||||
@ -487,6 +487,23 @@ async fn maintain_remote_subscription(
|
||||
}
|
||||
}
|
||||
};
|
||||
// tell provider node we don't need their services anymore
|
||||
// (in case they did not close the subscription on their side,
|
||||
// such as in the 2-hour timeout case)
|
||||
kernel_message(
|
||||
our,
|
||||
rand::random(),
|
||||
Address {
|
||||
node: provider_node.to_string(),
|
||||
process: ETH_PROCESS_ID.clone(),
|
||||
},
|
||||
None,
|
||||
true,
|
||||
None,
|
||||
EthAction::UnsubscribeLogs(sub_id),
|
||||
send_to_loop,
|
||||
)
|
||||
.await;
|
||||
active_subscriptions
|
||||
.entry(target.clone())
|
||||
.and_modify(|sub_map| {
|
||||
|
Loading…
Reference in New Issue
Block a user