This commit is contained in:
2023-09-19 13:03:29 +01:00
parent 1c52db933f
commit dde730238d
12 changed files with 138 additions and 151 deletions

View File

@ -197,6 +197,28 @@ export class Query implements QueryBase {
this.#stopCheckTraces();
}
/**
* Insert a new trace as a placeholder
*/
insertCompletedTrace(subq: BuiltRawReqFilter, data: Readonly<Array<TaggedNostrEvent>>) {
const qt = new QueryTrace(
"",
subq.filters,
"",
() => {
// nothing to close
},
() => {
// nothing to progress
},
);
qt.sentToRelay();
qt.gotEose();
this.#tracing.push(qt);
this.feed.add(data);
return qt;
}
sendToRelay(c: Connection, subq: BuiltRawReqFilter) {
if (!this.#canSendQuery(c, subq)) {
return;