1
0
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:
pm47 2017-02-24 16:00:59 +01:00
parent 4d99e39184
commit 810aed301d
4 changed files with 5 additions and 5 deletions

View File

@ -107,7 +107,7 @@ class GUIUpdater(primaryStage: Stage, mainController: MainController, setup: Set
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}")
mainController.allChannelsList.add(new PeerChannel(channelAnnouncement))
Platform.runLater(new Runnable() {

View File

@ -1,6 +1,6 @@
package fr.acinq.eclair.router
import fr.acinq.bitcoin.BinaryData
import fr.acinq.bitcoin.{BinaryData, Satoshi}
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 ChannelDiscovered(ann: ChannelAnnouncement) extends NetworkEvent
case class ChannelDiscovered(ann: ChannelAnnouncement, capacity: Satoshi) extends NetworkEvent
case class ChannelLost(channelId: Long) extends NetworkEvent

View File

@ -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))
// TODO: check feature bit set
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)) {
stash.foreach(self ! _)
Nil

View File

@ -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.expectMsgType[WatchSpent]
eventListener.expectMsg(ChannelDiscovered(chan_ac))
eventListener.expectMsg(ChannelDiscovered(chan_ac, Satoshi(1000000)))
}
test("properly announce lost channels and nodes") { case (router, watcher) =>