Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #445 from helium/pevm/miner-metadata
Browse files Browse the repository at this point in the history
allow the parent app to override the metadata fun
  • Loading branch information
evanmcc committed May 18, 2020
2 parents 3977250 + c85e82e commit 2c5e0ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/blockchain_sup.erl
Expand Up @@ -73,14 +73,18 @@ init(Args) ->
[{group_delete_predicate, Pred}]
end,
BaseDir = proplists:get_value(base_dir, Args, "data"),

%% allow the parent app to change this if it needs to.
MetadataFun = application:get_env(blockchain, metadata_fun,
fun blockchain_worker:signed_metadata_fun/0),
SwarmWorkerOpts =
[
{key, proplists:get_value(key, Args)},
{base_dir, BaseDir},
{libp2p_proxy,
[{limit, application:get_env(blockchain, relay_limit, 25)}]},
{libp2p_peerbook,
[{signed_metadata_fun, fun blockchain_worker:signed_metadata_fun/0},
[{signed_metadata_fun, MetadataFun},
{notify_time, application:get_env(blockchain, peerbook_update_interval, timer:minutes(5))},
{allow_rfc1918, application:get_env(blockchain, peerbook_allow_rfc1918, false)}
]},
Expand Down

0 comments on commit 2c5e0ef

Please sign in to comment.