Skip to content

Commit b89c69a

Browse files
authored
fix: forward missing pending remote settlements to watchtower (#1151)
1 parent 2bafbcc commit b89c69a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

crates/fiber-bin/src/main.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use fnn::fiber::{graph::NetworkGraph, network::init_chain_hash, network::Network
1212
use fnn::rpc::server::start_rpc;
1313
use fnn::rpc::watchtower::{
1414
CreatePreimageParams, CreateWatchChannelParams, RemovePreimageParams, RemoveWatchChannelParams,
15-
UpdateLocalSettlementParams, UpdateRevocationParams, WatchtowerRpcClient,
15+
UpdateLocalSettlementParams, UpdatePendingRemoteSettlementParams, UpdateRevocationParams,
16+
WatchtowerRpcClient,
1617
};
1718
use fnn::store::Store;
1819
use fnn::tasks::{
@@ -558,6 +559,15 @@ async fn forward_event_to_client<T: WatchtowerRpcClient + Sync>(
558559
.await
559560
.expect(ASSUME_WATCHTOWER_CLIENT_CALL_OK);
560561
}
562+
NetworkServiceEvent::LocalCommitmentSigned(channel_id, settlement_data) => {
563+
watchtower_client
564+
.update_pending_remote_settlement(UpdatePendingRemoteSettlementParams {
565+
channel_id,
566+
settlement_data,
567+
})
568+
.await
569+
.expect(ASSUME_WATCHTOWER_CLIENT_CALL_OK);
570+
}
561571
NetworkServiceEvent::PreimageCreated(payment_hash, preimage) => {
562572
watchtower_client
563573
.create_preimage(CreatePreimageParams {

docs/biscuit-auth.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ rule(
102102
allow if right({channel_id}, "watchtower");
103103
"#,
104104
);
105+
rule(
106+
"update_pending_remote_settlement",
107+
r#"
108+
allow if write("watchtower");
109+
allow if right({channel_id}, "watchtower");
110+
"#,
111+
);
105112
rule(
106113
"update_local_settlement",
107114
r#"

0 commit comments

Comments
 (0)