Skip to content
Snippets Groups Projects

Resolve "Vérification de l’existence dans la piscine/sandbox/mempool"

1 file
+ 28
11
Compare changes
  • Side-by-side
  • Inline
+ 28
11
@@ -304,21 +304,38 @@ defmodule WS2P.Connection do
# https://git.duniter.org/nodes/common/doc/-/blob/ws2p_v2/rfc/0004_ws2p_v1.md#documents-rebound-policy
case object["body"] do
# TODO
%{"name" => "PEER", "peer" => doc} -> nil
# TODO
%{"name" => "TRANSACTION", "transaction" => doc} -> nil
# TODO
%{"name" => "MEMBERSHIP", "membership" => doc} -> nil
# TODO
%{"name" => "CERTIFICATION", "certification" => doc} -> nil
# TODO
%{"name" => "IDENTITY", "identity" => doc} -> Doc.Identity.verif(doc)
%{"name" => "PEER", "peer" => doc} ->
nil
%{"name" => "TRANSACTION", "transaction" => doc} ->
if Doc.Mempool.can_add?(doc) do
end
%{"name" => "MEMBERSHIP", "membership" => doc} ->
if Doc.Mempool.can_add?(doc) do
end
%{"name" => "CERTIFICATION", "certification" => doc} ->
if Doc.Mempool.can_add?(doc) do
end
%{"name" => "IDENTITY", "identity" => doc} ->
if Doc.Mempool.can_add?(doc) do
end
%{"name" => "REVOCATION", "revocation" => doc} ->
if Doc.Mempool.can_add?(doc) do
end
# TODO
%{"name" => "BLOCK", "block" => doc} -> nil
%{"name" => "BLOCK", "block" => doc} ->
nil
# TODO handling received heads
# https://git.duniter.org/nodes/common/doc/-/blob/ws2p_v2/rfc/0004_ws2p_v1.md#rebound-policy
# GenServer.call(WS2P.Cluster, {:heads_received, heads})
%{"name" => "HEAD", "heads" => heads} -> nil
%{"name" => "HEAD", "heads" => heads} ->
nil
end
end
|> IO.inspect()
Loading