Skip to content

Commit

Permalink
added name_root handling
Browse files Browse the repository at this point in the history
  • Loading branch information
randomlogin committed Jan 24, 2024
1 parent 42aa53d commit 627f3be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/chain.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ hsk_chain_add(hsk_chain_t *chain, const hsk_header_t *h) {
const uint8_t *hash = hsk_header_cache(hdr);

hsk_chain_log(chain, "adding block: %s\n", hsk_hex_encode32(hash));
hsk_chain_log(chain, "tree_root %s timestamp %d \n",
hsk_hex_encode32(hdr->name_root), hdr->time);

int64_t now = hsk_timedata_now(chain->td);

Expand Down
5 changes: 5 additions & 0 deletions src/hesiod.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ hsk_hesiod_resolve(hsk_dns_req_t *req, hsk_ns_t *ns) {
goto fail;
}

if (hsk_dns_is_subdomain(req->name, "name_root.tip.chain.hnsd.")) {
if (!hsk_hesiod_txt_push_hash("name_root.tip.chain.hnsd.", ns->pool->chain.tip->name_root, an))
goto fail;
}

if (hsk_dns_is_subdomain(req->name, "time.tip.chain.hnsd.")) {
if (!hsk_hesiod_txt_push_u64("time.tip.chain.hnsd.",
ns->pool->chain.tip->time,
Expand Down

0 comments on commit 627f3be

Please sign in to comment.