go-perun icon indicating copy to clipboard operation
go-perun copied to clipboard

Close channel automatically when settling

Open matthiasgeihs opened this issue 4 years ago • 0 comments

Related to https://github.com/hyperledger-labs/go-perun/pull/83#discussion_r666230937_

Problem: Closing a channel involves calling channel.Settle and channel.Close. It is easy to mix up the two, or forget to call one of them, and I don't see a case where I want to do one without the other.

Suggestion: Always close when settling.

Important: Closing a channel deletes it from the registry. We need to be careful not to delete virtual channels before all parent channels are closed.

matthiasgeihs avatar Jul 08 '21 14:07 matthiasgeihs