All entries will be dropped when there is at least one invalid one in banlist.json
. Fix this by only dropping invalid ones.
Also suggested in #20966 (comment)
All entries will be dropped when there is at least one invalid one in banlist.json
. Fix this by only dropping invalid ones.
Also suggested in #20966 (comment)
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
No conflicts as of last run.
Concept ACK. I don’t think this can be exploited, because the checks are static, so the only way to use it is to persuade people in banning an invalid address.
Still, a mistake in one entry of user input should not prevent the whole ban thing from working.
15+
16+BOOST_FIXTURE_TEST_SUITE(banman_tests, BasicTestingSetup)
17+
18+BOOST_AUTO_TEST_CASE(file)
19+{
20+ SetMockTime(777s);
66 CSubNet subnet;
67 const auto& subnet_str = ban_entry_json[BANMAN_JSON_ADDR_KEY].get_str();
68 if (!LookupSubNet(subnet_str, subnet)) {
69- throw std::runtime_error(
70- strprintf("Cannot parse banned address or subnet: %s", subnet_str));
71+ LogPrintf("Dropping entry with unparseable address or subnet: %s\n", subnet_str);
Currently all entries in the file are dropped. Fix that by only dropping the invalid ones
Thanks, should be trivial to re-review with:
0git range-diff bitcoin-core/master eeee738d1c faa6c3d44c --word-diff-regex=.