mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-14 12:43:19 +02:00
close was issued with unilateraltimeout=180 on a fixed timer, without regard to the peer's connection state, while one complaint source (ComplainerByLowConnectRate) selects peers specifically for a low connect rate. Closing while the peer is offline escalates to a unilateral force-close after 3 minutes, against exactly the peers least likely to negotiate a mutual close in time. Check the peer's channels for a live connection (listpeerchannels peer_connected) before issuing close, and defer while the peer is offline. Poll close candidates every 10 minutes rather than once per solicitation cycle, so a flaky peer's brief online windows are actually caught. If the peer stays offline for close_patience (3 days), close anyway and let the short unilateral timeout escalate; the first-deferred time is persisted in a new PeerComplaintsDesk_closepending table so restarts do not reset the patience window. The fees_low gate applies only to that unilateral path: a mutual close even at high feerates is cheaper than a unilateral at low feerates, so connected peers are closed immediately regardless of feerate. Add tests/boss/test_peercomplaintsdesk_main.cpp covering the close paths: a connected peer closes immediately; an offline peer defers and the deferral survives a restart; within patience it holds; expired patience holds at high fees and closes at low fees; dropping below the complaint threshold sweeps the deferral; channel destruction clears it; disabled auto-close closes nothing. The test drives the module over the bus with a mock CLN on a socketpair. Reported by an external security researcher via private disclosure. Fixes #324 |
||
|---|---|---|
| .. | ||
| channelcandidateinvestigator | ||
| test_availablerpccommandsannouncer.cpp | ||
| test_channel_create_destroy_monitor_missing_old_state.cpp | ||
| test_channelcreationdecider.cpp | ||
| test_channelcreator_planner.cpp | ||
| test_channelcreator_rearrangerbysize.cpp | ||
| test_channelcreator_reprioritizer.cpp | ||
| test_earningshistory.cpp | ||
| test_earningsrebalancer.cpp | ||
| test_earningstracker.cpp | ||
| test_feemodderbypricetheory.cpp | ||
| test_feemon_history.cpp | ||
| test_forwardfeemonitor.cpp | ||
| test_getmanifest.cpp | ||
| test_initialrebalancer.cpp | ||
| test_initiator_listconfigs_proxy.cpp | ||
| test_invoicepayer_decodepay.cpp | ||
| test_jitrebalancer.cpp | ||
| test_needsconnectsolicitor.cpp | ||
| test_onchainfeemonitor_samples_init.cpp | ||
| test_peercomplaintsdesk_main.cpp | ||
| test_peercomplaintsdesk_recorder.cpp | ||
| test_peerjudge_agetracker.cpp | ||
| test_peerjudge_algo.cpp | ||
| test_peerjudge_datagatherer.cpp | ||
| test_peerstatistician.cpp | ||
| test_recentearnings.cpp | ||
| test_reqresp.cpp | ||
| test_rpc.cpp | ||
| test_stringid.cpp | ||
| test_swapmanager.cpp | ||
| test_unmanagedmanager.cpp | ||
| test_version.cpp | ||
| test_waiter_timed.cpp | ||