config+server+networktest: make trickleDelay configurable

Add option to set trickleDelay for AuthenticatedGossiper in
command line, with default value of 300 milliseconds. Pass this
value to newServer, which uses it when creating a new instance of
AuthenticatedGossiper. Also set this value to 300 milliseconds when
creating nodes in integration tests.
This commit is contained in:
Laura Cressman authored and Olaoluwa Osuntokun committed 2017-11-15 16:50:19 -08:00
1 parent 39d38da732
commit ed6ad22e85
4 files changed
+25 -13

No files matched your search

+5
View File
@@ -36,6 +36,7 @@ const (
defaultMaxPendingChannels = 1
defaultNumChanConfs = 1
defaultNoEncryptWallet = false
defaultTrickleDelay = 30 * 1000
)
var (
@@ -130,7 +131,10 @@ type config struct {
NoNetBootstrap bool `long:"nobootstrap" description:"If true, then automatic network bootstrapping will not be attempted."`
NoEncryptWallet bool `long:"noencryptwallet" description:"If set, wallet will be encrypted using the default passphrase."`
TrickleDelay int `long:"trickledelay" description:"Time in milliseconds between each release of announcements to the network"`
}
// loadConfig initializes and parses the config using a config file and command
@@ -169,6 +173,7 @@ func loadConfig() (*config, error) {
MaxChannels: 5,
Allocation: 0.6,
},
TrickleDelay: defaultTrickleDelay,
}
// Pre-parse the command line options to pick up an alternative config