mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-18 21:34:39 +01:00
Add listPendingChannels to LND (#4603)
This commit is contained in:
parent
e413f04106
commit
64bc1367c5
@ -76,7 +76,21 @@ class LndRpcClientPairTest extends DualLndFixture {
|
||||
pushAmt = Satoshis(10),
|
||||
satPerVByte = SatoshisPerVirtualByte.one,
|
||||
privateChannel = false)
|
||||
} yield assert(outpointOpt.isDefined)
|
||||
|
||||
pendingA <- lndA.listPendingChannels()
|
||||
pendingB <- lndB.listPendingChannels()
|
||||
} yield {
|
||||
assert(outpointOpt.isDefined)
|
||||
val outpoint = outpointOpt.get
|
||||
val expectedOutpoint = s"${outpoint.txId.hex}:${outpoint.vout.toInt}"
|
||||
|
||||
assert(
|
||||
pendingA.pendingOpenChannels.exists(
|
||||
_.channel.get.channelPoint == expectedOutpoint))
|
||||
assert(
|
||||
pendingB.pendingOpenChannels.exists(
|
||||
_.channel.get.channelPoint == expectedOutpoint))
|
||||
}
|
||||
}
|
||||
|
||||
it must "close a channel" in { param =>
|
||||
|
@ -509,6 +509,12 @@ class LndRpcClient(val instance: LndInstance, binaryOpt: Option[File] = None)(
|
||||
.map(_.channels.toVector)
|
||||
}
|
||||
|
||||
def listPendingChannels(): Future[PendingChannelsResponse] = {
|
||||
logger.trace("lnd calling pendingchannels")
|
||||
|
||||
lnd.pendingChannels(PendingChannelsRequest())
|
||||
}
|
||||
|
||||
def findChannel(
|
||||
channelPoint: TransactionOutPoint): Future[Option[Channel]] = {
|
||||
listChannels().map { channels =>
|
||||
|
Loading…
Reference in New Issue
Block a user