Return optional error from ApplyArgsManOptions

Also pass in a (for now unused) reference to the params.

Both changes are needed for the next commit.
This commit is contained in:
MacroFake
2022-07-20 15:48:52 +02:00
parent 816ca01650
commit fa468bdfb6
5 changed files with 21 additions and 4 deletions

View File

@@ -1418,7 +1418,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
.estimator = node.fee_estimator.get(),
.check_ratio = chainparams.DefaultConsistencyChecks() ? 1 : 0,
};
ApplyArgsManOptions(args, mempool_opts);
if (const auto err{ApplyArgsManOptions(args, chainparams, mempool_opts)}) {
return InitError(*err);
}
mempool_opts.check_ratio = std::clamp<int>(mempool_opts.check_ratio, 0, 1'000'000);
int64_t descendant_limit_bytes = mempool_opts.limits.descendant_size_vbytes * 40;