MCPcopy
hub / github.com/lhartikk/naivechain / responseLatestMsg

Function responseLatestMsg

main.js:200–203  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

198 'type': MessageType.RESPONSE_BLOCKCHAIN, 'data': JSON.stringify(blockchain)
199});
200var responseLatestMsg = () => ({
201 'type': MessageType.RESPONSE_BLOCKCHAIN,
202 'data': JSON.stringify([getLatestBlock()])
203});
204
205var write = (ws, message) => ws.send(JSON.stringify(message));
206var broadcast = (message) => sockets.forEach(socket => write(socket, message));

Callers 4

initHttpServerFunction · 0.85
initMessageHandlerFunction · 0.85
handleBlockchainResponseFunction · 0.85
replaceChainFunction · 0.85

Calls 1

getLatestBlockFunction · 0.85

Tested by

no test coverage detected