mirror of
https://github.com/ACINQ/eclair.git
synced 2024-11-20 02:27:32 +01:00
added capacity to ChannelDiscovered event
This commit is contained in:
parent
4d99e39184
commit
810aed301d
@ -107,7 +107,7 @@ class GUIUpdater(primaryStage: Stage, mainController: MainController, setup: Set
|
|||||||
override def run = mainController.allNodesTab.setText(s"Nodes (${mainController.allNodesList.size})")
|
override def run = mainController.allNodesTab.setText(s"Nodes (${mainController.allNodesList.size})")
|
||||||
})
|
})
|
||||||
|
|
||||||
case ChannelDiscovered(channelAnnouncement) =>
|
case ChannelDiscovered(channelAnnouncement, _) =>
|
||||||
log.debug(s"peer channel discovered with channel id = ${channelAnnouncement.channelId}")
|
log.debug(s"peer channel discovered with channel id = ${channelAnnouncement.channelId}")
|
||||||
mainController.allChannelsList.add(new PeerChannel(channelAnnouncement))
|
mainController.allChannelsList.add(new PeerChannel(channelAnnouncement))
|
||||||
Platform.runLater(new Runnable() {
|
Platform.runLater(new Runnable() {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package fr.acinq.eclair.router
|
package fr.acinq.eclair.router
|
||||||
|
|
||||||
import fr.acinq.bitcoin.BinaryData
|
import fr.acinq.bitcoin.{BinaryData, Satoshi}
|
||||||
import fr.acinq.eclair.wire.{ChannelAnnouncement, NodeAnnouncement}
|
import fr.acinq.eclair.wire.{ChannelAnnouncement, NodeAnnouncement}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,6 +14,6 @@ case class NodeUpdated(ann: NodeAnnouncement) extends NetworkEvent
|
|||||||
|
|
||||||
case class NodeLost(nodeId: BinaryData) extends NetworkEvent
|
case class NodeLost(nodeId: BinaryData) extends NetworkEvent
|
||||||
|
|
||||||
case class ChannelDiscovered(ann: ChannelAnnouncement) extends NetworkEvent
|
case class ChannelDiscovered(ann: ChannelAnnouncement, capacity: Satoshi) extends NetworkEvent
|
||||||
|
|
||||||
case class ChannelLost(channelId: Long) extends NetworkEvent
|
case class ChannelLost(channelId: Long) extends NetworkEvent
|
||||||
|
@ -96,7 +96,7 @@ class Router(watcher: ActorRef) extends Actor with ActorLogging {
|
|||||||
watcher ! WatchSpent(self, tx.txid, outputIndex, BITCOIN_FUNDING_OTHER_CHANNEL_SPENT(c.channelId))
|
watcher ! WatchSpent(self, tx.txid, outputIndex, BITCOIN_FUNDING_OTHER_CHANNEL_SPENT(c.channelId))
|
||||||
// TODO: check feature bit set
|
// TODO: check feature bit set
|
||||||
log.info(s"added channel channelId=${c.channelId}")
|
log.info(s"added channel channelId=${c.channelId}")
|
||||||
context.system.eventStream.publish(ChannelDiscovered(c))
|
context.system.eventStream.publish(ChannelDiscovered(c, output.amount))
|
||||||
val stash1 = if (awaiting == Set(c)) {
|
val stash1 = if (awaiting == Set(c)) {
|
||||||
stash.foreach(self ! _)
|
stash.foreach(self ! _)
|
||||||
Nil
|
Nil
|
||||||
|
@ -32,7 +32,7 @@ class RouterSpec extends BaseRouterSpec {
|
|||||||
watcher.send(router, GetTxResponse(Transaction(version = 0, txIn = Nil, txOut = TxOut(Satoshi(1000000), write(pay2wsh(Scripts.multiSig2of2(funding_a, funding_c)))) :: Nil, lockTime = 0), true, chan_ac))
|
watcher.send(router, GetTxResponse(Transaction(version = 0, txIn = Nil, txOut = TxOut(Satoshi(1000000), write(pay2wsh(Scripts.multiSig2of2(funding_a, funding_c)))) :: Nil, lockTime = 0), true, chan_ac))
|
||||||
watcher.expectMsgType[WatchSpent]
|
watcher.expectMsgType[WatchSpent]
|
||||||
|
|
||||||
eventListener.expectMsg(ChannelDiscovered(chan_ac))
|
eventListener.expectMsg(ChannelDiscovered(chan_ac, Satoshi(1000000)))
|
||||||
}
|
}
|
||||||
|
|
||||||
test("properly announce lost channels and nodes") { case (router, watcher) =>
|
test("properly announce lost channels and nodes") { case (router, watcher) =>
|
||||||
|
Loading…
Reference in New Issue
Block a user