mirror of
https://github.com/ACINQ/eclair.git
synced 2024-11-19 09:54:02 +01:00
cc3395a5bb
* don't spam with channel_updates at startup Previous logic was very simple but naive: - every time a channel_update changed we would send it out - we would always make a new channel_update with the disabled flag set at startup. In case our node was simply restarted, this resulted in us re-sending a channel_update with the disabled flag set, then a second one with the disabled flag unset a few seconds later, for each public channel. On top of that, this opened way to a bug: if reconnection is very fast, then the two successive channel_update will have the same timestamp, causing the router to not send the second one, which means that the channel would be considered disabled by the network, and excluded from payments. The new logic is as follows: - when we do NORMAL->NORMAL or NORMAL->OFFLINE or OFFLINE->NORMAL, we send out the new channel_update if it has changed - in all other case (e.g. WAIT_FOR_INIT_INTERNAL->OFFLINE) we do nothing As a side effect, if we were connected to a peer, then we shut down eclair, then the peer goes down, then we restart eclair: we will make a new channel_update with the disabled flag set but we won't broadcast it. If someone tries to make a payment to that node, we will return the new channel_update with disabled flag set (and maybe the payer will then broadcast that channel_update). So even in that corner case we are good. * quick reconnection: bump channel_update timestamp In case of a disconnection-reconnection, we first generate a channel_update with disabled bit set, then after we reconnect we generate a second channel_update with disabled bit not set. If this happens very quickly, then both channel_updates will have the same timestamp, and the second one will get ignored by the network. A simple fix is to bump the second timestamp in this case. * set channel_update refresh timer at reconnection We only care about this timer when connected anyway. We also cancel it when disconnecting. This has several advantages: - having a static task resulted in unnecessary refresh if the channel got disconnected/reconnected in between 2 weeks - better repartition of the channel_update refresh over time because at startup all channels were generated at the same time causing all refresh tasks to be synchronized - less overhead for the scheduler (because we cancel refresh task for offline channels (minor, but still)
254 lines
9.4 KiB
XML
254 lines
9.4 KiB
XML
<!--
|
|
~ Copyright 2018 ACINQ SAS
|
|
~
|
|
~ Licensed under the Apache License, Version 2.0 (the "License");
|
|
~ you may not use this file except in compliance with the License.
|
|
~ You may obtain a copy of the License at
|
|
~
|
|
~ http://www.apache.org/licenses/LICENSE-2.0
|
|
~
|
|
~ Unless required by applicable law or agreed to in writing, software
|
|
~ distributed under the License is distributed on an "AS IS" BASIS,
|
|
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
~ See the License for the specific language governing permissions and
|
|
~ limitations under the License.
|
|
-->
|
|
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<groupId>fr.acinq.eclair</groupId>
|
|
<artifactId>eclair_2.11</artifactId>
|
|
<version>0.2-SNAPSHOT</version>
|
|
<packaging>pom</packaging>
|
|
|
|
<modules>
|
|
<module>eclair-core</module>
|
|
<module>eclair-node</module>
|
|
<module>eclair-node-gui</module>
|
|
</modules>
|
|
|
|
<description>A scala implementation of the Lightning Network</description>
|
|
<url>https://github.com/ACINQ/eclair</url>
|
|
<name>${project.artifactId}</name>
|
|
|
|
<licenses>
|
|
<license>
|
|
<url>https://raw.githubusercontent.com/ACINQ/eclair/master/LICENSE</url>
|
|
<name>Apache License</name>
|
|
<distribution>repo</distribution>
|
|
</license>
|
|
</licenses>
|
|
|
|
<scm>
|
|
<connection>scm:git:git@github.com:ACINQ/eclair.git</connection>
|
|
<developerConnection>scm:git:git@github.com:ACINQ/eclair.git</developerConnection>
|
|
<url>git@github.com:ACINQ/eclair.git</url>
|
|
</scm>
|
|
|
|
<developers>
|
|
<developer>
|
|
<id>dpad85</id>
|
|
</developer>
|
|
<developer>
|
|
<id>pm47</id>
|
|
</developer>
|
|
<developer>
|
|
<id>sstone</id>
|
|
</developer>
|
|
</developers>
|
|
|
|
<properties>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<maven.compiler.source>1.8</maven.compiler.source>
|
|
<maven.compiler.target>1.8</maven.compiler.target>
|
|
<scala.version>2.11.12</scala.version>
|
|
<scala.version.short>2.11</scala.version.short>
|
|
<akka.version>2.4.20</akka.version>
|
|
<akka.http.version>10.0.11</akka.http.version>
|
|
<sttp.version>1.3.9</sttp.version>
|
|
<bitcoinlib.version>0.10</bitcoinlib.version>
|
|
<guava.version>24.0-android</guava.version>
|
|
</properties>
|
|
|
|
<build>
|
|
<pluginManagement>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
<version>3.0.2</version>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
<version>3.0.2</version>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>com.github.chrisdchristo</groupId>
|
|
<artifactId>capsule-maven-plugin</artifactId>
|
|
<version>1.5.1</version>
|
|
</plugin>
|
|
</plugins>
|
|
</pluginManagement>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>versions-maven-plugin</artifactId>
|
|
<version>2.3</version>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>pl.project13.maven</groupId>
|
|
<artifactId>git-commit-id-plugin</artifactId>
|
|
<version>2.2.3</version>
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>revision</goal>
|
|
</goals>
|
|
<configuration>
|
|
<failOnNoGitDirectory>false</failOnNoGitDirectory>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>net.alchim31.maven</groupId>
|
|
<artifactId>scala-maven-plugin</artifactId>
|
|
<version>3.4.2</version>
|
|
<configuration>
|
|
<args combine.children="append">
|
|
<arg>-deprecation</arg>
|
|
<arg>-feature</arg>
|
|
<arg>-language:postfixOps</arg>
|
|
<arg>-language:implicitConversions</arg>
|
|
<arg>-Xfatal-warnings</arg>
|
|
<arg>-unchecked</arg>
|
|
<arg>-Xmax-classfile-name</arg>
|
|
<arg>140</arg>
|
|
<!-- needed to compile Scala code on JDK9+ -->
|
|
<arg>-nobootcp</arg>
|
|
</args>
|
|
<scalaCompatVersion>${scala.version.short}</scalaCompatVersion>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>scalac</id>
|
|
<goals>
|
|
<goal>compile</goal>
|
|
<goal>testCompile</goal>
|
|
</goals>
|
|
</execution>
|
|
<execution>
|
|
<id>scaladoc</id>
|
|
<goals>
|
|
<goal>doc-jar</goal>
|
|
</goals>
|
|
<configuration>
|
|
<args>
|
|
<arg>-no-link-warnings</arg>
|
|
</args>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-source-plugin</artifactId>
|
|
<version>3.0.1</version>
|
|
<executions>
|
|
<execution>
|
|
<id>attach-sources</id>
|
|
<goals>
|
|
<goal>jar</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.codehaus.mojo</groupId>
|
|
<artifactId>build-helper-maven-plugin</artifactId>
|
|
<version>3.0.0</version>
|
|
<executions>
|
|
<execution>
|
|
<id>add-source</id>
|
|
<phase>generate-sources</phase>
|
|
<goals>
|
|
<goal>add-source</goal>
|
|
</goals>
|
|
<configuration>
|
|
<sources>
|
|
<source>src/main/scala</source>
|
|
</sources>
|
|
</configuration>
|
|
</execution>
|
|
<execution>
|
|
<id>add-test-source</id>
|
|
<phase>generate-test-sources</phase>
|
|
<goals>
|
|
<goal>add-test-source</goal>
|
|
</goals>
|
|
<configuration>
|
|
<sources>
|
|
<source>src/test/scala</source>
|
|
</sources>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<!-- disable surefire -->
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<version>2.20</version>
|
|
<configuration>
|
|
<skipTests>true</skipTests>
|
|
</configuration>
|
|
</plugin>
|
|
<!-- enable scalatest -->
|
|
<plugin>
|
|
<groupId>org.scalatest</groupId>
|
|
<artifactId>scalatest-maven-plugin</artifactId>
|
|
<version>2.0.0</version>
|
|
<configuration>
|
|
<parallel>false</parallel>
|
|
<systemProperties>
|
|
<buildDirectory>${project.build.directory}</buildDirectory>
|
|
</systemProperties>
|
|
<argLine>-Xmx1024m</argLine>
|
|
</configuration>
|
|
<executions>
|
|
<execution>
|
|
<id>test</id>
|
|
<goals>
|
|
<goal>test</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
|
|
<repositories>
|
|
<repository>
|
|
<id>sonatype snapshots</id>
|
|
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>org.scala-lang</groupId>
|
|
<artifactId>scala-library</artifactId>
|
|
<version>${scala.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.scalatest</groupId>
|
|
<artifactId>scalatest_${scala.version.short}</artifactId>
|
|
<version>3.0.5</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|