Skip to content

Commit

Permalink
Refactor: Exported dandelion shuffle interval into external constant
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartArray committed Aug 15, 2021
1 parent 3a7b9fd commit 48227d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
CConnman* connman = node.connman.get();
node.scheduler->scheduleEvery([connman]{
connman->CheckDandelionShuffle();
}, std::chrono::milliseconds{1000});
}, CHECK_DANDELION_SHUFFLE_INTERVAL);

#if HAVE_SYSTEM
StartupNotify(args);
Expand Down
3 changes: 3 additions & 0 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ static const size_t DEFAULT_MAXRECEIVEBUFFER = 5 * 1000;
static const size_t DEFAULT_MAXSENDBUFFER = 1 * 1000;

typedef std::chrono::seconds sec;
typedef std::chrono::milliseconds msec;

/** Maximum number of outbound peers designated as Dandelion destinations */
static const int DANDELION_MAX_DESTINATIONS = 2;
Expand All @@ -96,6 +97,8 @@ static const sec DANDELION_SHUFFLE_INTERVAL = sec(600);
static const sec DANDELION_EMBARGO_MINIMUM = sec(10);
/** The average additional embargo time beyond the minimum amount */
static const sec DANDELION_EMBARGO_AVG_ADD = sec(20);
/** The time to wait for the scheduler before rerunning Dandelion shuffle check */
static const msec CHECK_DANDELION_SHUFFLE_INTERVAL = msec(1000);

typedef int64_t NodeId;

Expand Down

0 comments on commit 48227d4

Please sign in to comment.