Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit ec2f277

Browse files
committed
Only Force if No Peer
1 parent 8078b43 commit ec2f277

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/lightning-core/accounts/ChannelListItem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ export const ChannelListItem = ({ id, capacity, localBalance, remoteBalance,
9191
const PROMPT = 'CHANNEL_LIST/PROMPT'
9292

9393
// eslint-disable-next-line
94-
const close = ({ channelPoint }) => {
95-
const call = onCloseChannel({ channelPoint })
94+
const close = ({ channelPoint, force }) => {
95+
const call = onCloseChannel({ channelPoint, force })
9696
call.on('data', () => {
9797
onSuccess('Channel Closed')
9898
onFetchChannels()
@@ -106,7 +106,7 @@ export const ChannelListItem = ({ id, capacity, localBalance, remoteBalance,
106106
menu.append(new MenuItem({ label: 'Close Channel', click() { showPopupOrClose() } }))
107107
const handleMenu = () => menu.popup(remote.getCurrentWindow())
108108
const handleClose = () => {
109-
close({ channelPoint })
109+
close({ channelPoint, force: true })
110110
onClosePopup(PROMPT)
111111
}
112112
const handleCancel = () => onClosePopup(PROMPT)

packages/lightning-core/accounts/reducer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export const actions = {
196196
.catch(rejectError)
197197
})
198198
},
199-
closeChannel: ({ channelPoint }) => {
199+
closeChannel: ({ channelPoint, force = false }) => {
200200
const txid = channelPoint.split(':')[0]
201201
const index = channelPoint.split(':')[1]
202202
return {
@@ -208,7 +208,7 @@ export const actions = {
208208
funding_txid: new Buffer(txid, 'hex').reverse(),
209209
output_index: parseInt(index, 10),
210210
},
211-
force: true,
211+
force,
212212
},
213213
stream: true,
214214
},

0 commit comments

Comments
 (0)