| 309 | |
| 310 | |
| 311 | void NeighborTable::holdOff(const char* address, unsigned seconds) |
| 312 | { |
| 313 | if (mDB == NULL) { return; } // we already threw an ALERT. |
| 314 | assert(address); |
| 315 | LOG(DEBUG) << "address " << address << " seconds " << seconds; |
| 316 | |
| 317 | if (!seconds) return; |
| 318 | |
| 319 | time_t holdoffTime = time(NULL) + seconds; |
| 320 | char query[200]; |
| 321 | sprintf(query,"UPDATE NEIGHBOR_TABLE SET HOLDOFF=%lu WHERE IPADDRESS='%s'", |
| 322 | holdoffTime, address); |
| 323 | if (!sqlite3_command(mDB,query)) { |
| 324 | LOG(ALERT) << "cannot access neighbor table"; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | void NeighborTable::holdOff(const struct sockaddr_in* peer, unsigned seconds) |
| 329 | { |
no outgoing calls
no test coverage detected