Skip to content

Commit fae191e

Browse files
committed
fix: forward missing pending remote settlements to watchtower
1 parent 34c95d0 commit fae191e

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::{
@@ -559,6 +560,15 @@ async fn forward_event_to_client<T: WatchtowerRpcClient + Sync>(
559560
.await
560561
.expect(ASSUME_WATCHTOWER_CLIENT_CALL_OK);
561562
}
563+
NetworkServiceEvent::LocalCommitmentSigned(channel_id, settlement_data) => {
564+
watchtower_client
565+
.update_pending_remote_settlement(UpdatePendingRemoteSettlementParams {
566+
channel_id,
567+
settlement_data,
568+
})
569+
.await
570+
.expect(ASSUME_WATCHTOWER_CLIENT_CALL_OK);
571+
}
562572
NetworkServiceEvent::PreimageCreated(payment_hash, preimage) => {
563573
watchtower_client
564574
.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)