mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-19 09:36:43 +00:00
bugfix: NIP-20 says duplicate messages should return written = true
This commit is contained in:
@ -85,7 +85,7 @@ void RelayServer::ingesterProcessEvent(lmdb::txn &txn, uint64_t connId, secp256k
|
||||
auto existing = lookupEventById(txn, sv(flat->id()));
|
||||
if (existing) {
|
||||
LI << "Duplicate event, skipping";
|
||||
sendOKResponse(connId, to_hex(sv(flat->id())), false, "duplicate: have this event");
|
||||
sendOKResponse(connId, to_hex(sv(flat->id())), true, "duplicate: have this event");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ void RelayServer::runWriter(ThreadPool<MsgWriter>::Thread &thr) {
|
||||
written = true;
|
||||
} else if (newEvent.status == EventWriteStatus::Duplicate) {
|
||||
message = "duplicate: have this event";
|
||||
written = true;
|
||||
} else if (newEvent.status == EventWriteStatus::Replaced) {
|
||||
message = "replaced: have newer event";
|
||||
} else if (newEvent.status == EventWriteStatus::Deleted) {
|
||||
|
Reference in New Issue
Block a user