Conversation
81a76a1 to
4cca431
Compare
| @@ -68,7 +78,7 @@ void RelayServer::runIngester(ThreadPool<MsgIngester>::Thread &thr) { | |||
| sendNoticeError(msg->connId, std::string("bad close: ") + e.what()); | |||
| } | |||
| } else if (cmd.starts_with("NEG-")) { | |||
There was a problem hiding this comment.
I think it'd be better to just enumerate the known commands here, rather than using starts_with. Then there's no need for a separate normalize function, and it's more consistent with the other branches.
There was a problem hiding this comment.
and ignore the unknowns from metrics?
There was a problem hiding this comment.
Yeah I think so. Unknown commands that don't start with NEG- are ignored in the metrics. So either we should make it work for all unknown commands, or just ignore it. Probably the later since unknown commands are just dropped anyway.
There was a problem hiding this comment.
done! enumerated the four NEG- commands as in NIP-77. anything else is ignored.
4cca431 to
742a03e
Compare
| sendNoticeError(msg->connId, std::string("bad close: ") + e.what()); | ||
| } | ||
| } else if (cmd.starts_with("NEG-")) { | ||
| } else if (cmd == "NEG-OPEN" || cmd == "NEG-MSG" || cmd == "NEG-CLOSE" || cmd == "NEG-ERR") { |
There was a problem hiding this comment.
Looks good, but NEG-ERR is never valid in a client->relay message (see ingesterProcessNegentropy).
There was a problem hiding this comment.
hmm my bad. i checked nip 77 docs to confirm and enumerated all the types there. fixed now.
742a03e to
888f97d
Compare
Fixes #203