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

Commit 8cc1d96

Browse files
committed
Set targetConf on coop channel close
1 parent cfc4b7c commit 8cc1d96

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/action/channel.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* call the corresponding GRPC apis for channel management.
44
*/
55

6+
import { MED_TARGET_CONF } from '../config';
67
import { toSatoshis, poll, getTimeTilAvailable } from '../helper';
78
import * as log from './log';
89

@@ -316,6 +317,7 @@ class ChannelAction {
316317
const stream = this._grpc.sendStreamCommand('closeChannel', {
317318
channelPoint: this._parseChannelPoint(channelPoint),
318319
force,
320+
targetConf: force ? undefined : MED_TARGET_CONF,
319321
});
320322
await new Promise((resolve, reject) => {
321323
stream.on('data', data => {

test/unit/action/channel.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ describe('Action Channels Unit Tests', () => {
356356
.withArgs('closeChannel', {
357357
channelPoint: { fundingTxidStr: 'FFFF', outputIndex: 1 },
358358
force: false,
359+
targetConf: 16,
359360
})
360361
.returns({ on: onStub });
361362
await channel.closeChannel({ channelPoint });
@@ -371,6 +372,7 @@ describe('Action Channels Unit Tests', () => {
371372
.withArgs('closeChannel', {
372373
channelPoint: { fundingTxidStr: 'FFFF', outputIndex: 1 },
373374
force: true,
375+
targetConf: undefined,
374376
})
375377
.returns({ on: onStub });
376378
await channel.closeChannel({ channelPoint, force: true });

0 commit comments

Comments
 (0)