mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-19 17:37: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()));
|
auto existing = lookupEventById(txn, sv(flat->id()));
|
||||||
if (existing) {
|
if (existing) {
|
||||||
LI << "Duplicate event, skipping";
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ void RelayServer::runWriter(ThreadPool<MsgWriter>::Thread &thr) {
|
|||||||
written = true;
|
written = true;
|
||||||
} else if (newEvent.status == EventWriteStatus::Duplicate) {
|
} else if (newEvent.status == EventWriteStatus::Duplicate) {
|
||||||
message = "duplicate: have this event";
|
message = "duplicate: have this event";
|
||||||
|
written = true;
|
||||||
} else if (newEvent.status == EventWriteStatus::Replaced) {
|
} else if (newEvent.status == EventWriteStatus::Replaced) {
|
||||||
message = "replaced: have newer event";
|
message = "replaced: have newer event";
|
||||||
} else if (newEvent.status == EventWriteStatus::Deleted) {
|
} else if (newEvent.status == EventWriteStatus::Deleted) {
|
||||||
|
Reference in New Issue
Block a user