Skip to content

Commit

Permalink
Merge pull request #144 from AtomicalsBuilder/fix-len
Browse files Browse the repository at this point in the history
fix name_len error
  • Loading branch information
atomicals authored Mar 17, 2024
2 parents a70089d + 5bd129d commit e0063d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions electrumx/server/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -1654,7 +1654,7 @@ async def get_dmitem_entries_paginated(self, parent_container_id, limit, offset)
if current_counter > offset + limit:
break
# Use 4 bytes because of store name len as 4 bytes
name_len, = unpack_le_uint32_from(db_key[-10:-6])
name_len, = unpack_le_uint32_from(db_key[-12:-8])
dmitem_name = db_key[len(db_prefix)]
if entries_deduped.get(dmitem_name):
continue
Expand Down Expand Up @@ -1712,7 +1712,7 @@ def get_name_entries_template_limited(self, db_prefix, parent_prefix, subject_en
tx_numb = db_key[-8:]
tx_num, = unpack_le_uint64(tx_numb)
# Use 4 bytes because of store name len as 4 bytes
name_len, = unpack_le_uint32_from(db_key[-10:-6])
name_len, = unpack_le_uint32_from(db_key[-12:-8])
db_key_prefix_len = len(db_key_prefix)
entries.append({
'name': db_key[db_key_prefix_len : db_key_prefix_len + name_len].decode(), # Extract the name portion
Expand Down

0 comments on commit e0063d8

Please sign in to comment.