diff --git a/src/components/objects/Problem.svelte b/src/components/objects/Problem.svelte index 2b845c8..d9c6079 100644 --- a/src/components/objects/Problem.svelte +++ b/src/components/objects/Problem.svelte @@ -1,7 +1,7 @@ -

{problem.Title}

+

{#if problem.Title}{problem.Title}{:else}{/if}

{#if problem.Summary}
{problem.Summary}
{/if}
{#if problem.FullText}

{problem.FullText}

{/if} diff --git a/src/lib/consensus/mempool.ts b/src/lib/consensus/mempool.ts index 7455e46..f4e1f3d 100644 --- a/src/lib/consensus/mempool.ts +++ b/src/lib/consensus/mempool.ts @@ -1,16 +1,24 @@ -import { kindsThatNeedConsensus } from "$lib/kinds"; +import { allNostrocketEventKinds, kindsThatNeedConsensus } from "$lib/kinds"; import { rootEventID } from "$lib/settings"; import { labelledTag } from "$lib/stores/state"; import type { NDKEvent } from "@nostr-dev-kit/ndk"; import { get, writable } from "svelte/store"; -export default function createEventpool() { +export default function createEventpool(notstrict:boolean|undefined) { const raw = writable>(new Map()); const { subscribe, set, update } = raw; return { subscribe, push: (e: NDKEvent): void => { - if (labelledTag(e, "root", "e") == rootEventID) { + if (!notstrict) { + if (labelledTag(e, "root", "e") == rootEventID && allNostrocketEventKinds.includes(e.kind? e.kind : 0)) { + update((m) => { + m.set(e.id, e); + return m; + }); + } + } + if (notstrict) { update((m) => { m.set(e.id, e); return m; diff --git a/src/lib/helpers/bitcoin.ts b/src/lib/helpers/bitcoin.ts index c592893..72e1da8 100644 --- a/src/lib/helpers/bitcoin.ts +++ b/src/lib/helpers/bitcoin.ts @@ -17,9 +17,9 @@ function synchronousRequest(url: string): string { export function BitcoinHeightTag():string[] { let tip = BitcoinTipHeight() - let bths:string[] = ["h", "", ""] + let bths:string[] = ["h", ""] if (tip.hash && tip.height) { - bths = ["h", tip.height.toString(), tip.hash] + bths = ["h", tip.height.toString() + ":"+ tip.hash] } return bths } diff --git a/src/lib/stores/state.ts b/src/lib/stores/state.ts index c65a1f3..adfd55c 100644 --- a/src/lib/stores/state.ts +++ b/src/lib/stores/state.ts @@ -33,7 +33,7 @@ export const consensusTipState = writable(r); //this is the latest nostrocket st let changeStateMutex = new Mutex(); export const anek = $ndk.storeSubscribe( - { "#e": [rootEventID] }, //"#e": [ignitionEvent] , authors: [ignitionPubkey] kinds: allNostrocketEventKinds, "#e": [mainnetRoot] + { "#e": [rootEventID], kinds: allNostrocketEventKinds }, //"#e": [ignitionEvent] , authors: [ignitionPubkey] kinds: allNostrocketEventKinds, "#e": [mainnetRoot] { closeOnEose: false } ); @@ -167,6 +167,9 @@ export let notPrecalculatedStateEvents = derived(allNostrocketEvents, ($nr) => { export let validConsensusEvents = derived(allNostrocketEvents, ($vce) => { + $vce = $vce.filter((event:NDKEvent) => { + return (labelledTag(event, "root", "e") == rootEventID) + }) $vce = $vce.filter((event: NDKEvent) => { return validate(event, get(consensusTipState)); });