Skip to content

Commit

Permalink
Merge pull request #1696 from theQRL/dev
Browse files Browse the repository at this point in the history
Adds small fixes for explorer nodes
  • Loading branch information
jplomas authored Mar 30, 2020
2 parents bcf7644 + 64e09b8 commit f457b3a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/qrl/core/ChainManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def get_inbox_message_transaction_hashes(self, address: bytes, item_index: int)
with self.lock:
return p.get_paginated_data(address, item_index)

def get_vote_stats(self, multi_sig_spend_txn_hash: bytes):
def get_vote_stats(self, multi_sig_spend_txn_hash: bytes) -> VoteStats:
with self.lock:
return VoteStats.get_state(state=self._state, shared_key=multi_sig_spend_txn_hash)

Expand Down
1 change: 1 addition & 0 deletions src/qrl/core/VoteStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def __init__(self, protobuf_block=None):
if protobuf_block is None:
self._data = qrl_pb2.VoteStats()

@property
def pbdata(self):
return self._data

Expand Down
6 changes: 3 additions & 3 deletions src/qrl/core/qrlnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,10 @@ def get_ots(self,
max_bitfield = 2 ** OptimizedAddressState.get_height_from_address(address)
max_pages = (max_bitfield // config.dev.ots_tracking_per_page) + 1
page_from = min(page_from, max_pages)
max_pages = min(page_from + page_count, max_pages)
max_pages = min(page_from + page_count - 1, max_pages)

bitfields = list()
for page in range(page_from, max_pages):
for page in range(page_from, max_pages + 1):
bitfield = self._chain_manager.get_bitfield(address, page)
bitfields.append(qrl_pb2.OTSBitfieldByPage(ots_bitfield=bitfield, page_number=page))

Expand Down Expand Up @@ -666,7 +666,7 @@ def get_multi_sig_spend_txs_by_address(self,

def get_vote_stats(self, multi_sig_spend_tx_hash: bytes):
vote_stats = self._chain_manager.get_vote_stats(multi_sig_spend_tx_hash)
return qrl_pb2.GetVoteStatsResp(vote_stats=vote_stats)
return qrl_pb2.GetVoteStatsResp(vote_stats=vote_stats.pbdata)

def get_inbox_messages_by_address(self, address: bytes, item_per_page: int, page_number: int):
if item_per_page == 0:
Expand Down

0 comments on commit f457b3a

Please sign in to comment.