| 108 | } |
| 109 | |
| 110 | bool api::cnd::SyncBlocks::parse_filename(const std::string &filename, Height *ha) { |
| 111 | std::string aa[3]; |
| 112 | if (!common::split_string(filename, "/", aa[0], aa[1], aa[2])) |
| 113 | return false; |
| 114 | Height h = 0; |
| 115 | try { |
| 116 | for (size_t i = 0; i != 3; ++i) { |
| 117 | Height part = common::integer_cast<Height>(aa[i]); |
| 118 | if (digit3(part) != aa[i]) |
| 119 | return false; // leading zeros, spaces, etc |
| 120 | h = h * 1000 + part; |
| 121 | } |
| 122 | *ha = h; |
| 123 | return true; |
| 124 | } catch (const std::exception &) { |
| 125 | } |
| 126 | return false; |
| 127 | } |
| 128 | |
| 129 | bool api::cnd::SyncBlocks::is_static_redirect(const std::string &body, Height *ha) { |
| 130 | try { |
nothing calls this directly
no test coverage detected