mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
lnwallet: add delivery scripts as a param to CreateCloseProposal+ CompleteCooperativeClose
This commit modifies the methods that transition the state of the channel into an active closing state. With the new commitment design, the delivery scripts are no longer pre-committed to the initial funding messages. Instead, the scripts are sent at the instant that either side decides to shutdown within the Shutdown message.
This commit is contained in:
parent
40e9120c04
commit
8121bc77ce
@ -3644,9 +3644,9 @@ func (lc *LightningChannel) ForceClose() (*ForceCloseSummary, error) {
|
||||
// returned.
|
||||
//
|
||||
// TODO(roasbeef): caller should initiate signal to reject all incoming HTLCs,
|
||||
// settle any inflight.
|
||||
func (lc *LightningChannel) CreateCloseProposal(feeRate uint64) ([]byte, uint64,
|
||||
error) {
|
||||
// settle any in flight.
|
||||
func (lc *LightningChannel) CreateCloseProposal(feeRate uint64,
|
||||
localDeliveryScript, remoteDeliveryScript []byte) ([]byte, uint64, error) {
|
||||
|
||||
lc.Lock()
|
||||
defer lc.Unlock()
|
||||
@ -3706,8 +3706,10 @@ func (lc *LightningChannel) CreateCloseProposal(feeRate uint64) ([]byte, uint64,
|
||||
//
|
||||
// NOTE: The passed local and remote sigs are expected to be fully complete
|
||||
// signatures including the proper sighash byte.
|
||||
func (lc *LightningChannel) CompleteCooperativeClose(localSig, remoteSig []byte,
|
||||
func (lc *LightningChannel) CompleteCooperativeClose(localSig, remoteSig,
|
||||
localDeliveryScript, remoteDeliveryScript []byte,
|
||||
feeRate uint64) (*wire.MsgTx, error) {
|
||||
|
||||
lc.Lock()
|
||||
defer lc.Unlock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user