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)
Concept ACK
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
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);
Dropping this seems to break the test, but I don't understand why. Perhaps a comment?
Ban entries from the past (banned_until=778) will be dropped, unless the time is less than that.
ACK fa7f08ddad1c7741ead1589730b56262ee9aeb9c
Rebased to fix silent and explicit merge conflict. Should be trivial to re-ACK
ACK eeee738d1c4b584968b816309dff78c8011d34bf
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);
I think this error message needs to include the context (maybe "ban list entry" instead of "entry").
Code review ACK eeee738d1c4b584968b816309dff78c8011d34bf Small nit about error message.
Currently all entries in the file are dropped. Fix that by only dropping the invalid ones
Thanks, should be trivial to re-review with:
git range-diff bitcoin-core/master eeee738d1c faa6c3d44c --word-diff-regex=.
Re-ACK faa6c3d44c861c0486c1369e1d098b7645ab07cd