Skip to content

Commit

Permalink
Filter out minor block headers with larger create time (#780)
Browse files Browse the repository at this point in the history
* Filter out minor block headers with larger create time

* remove invalid minor block header

* remove empty line

* remove invalid minor blocks when create bloack to mine

* remove empty line
  • Loading branch information
hanyunx authored Oct 28, 2019
1 parent ab61d04 commit 5310b34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quarkchain/cluster/root_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ def create_block_to_mine(self, m_header_list, address=None, create_time=None):
block = self.tip.create_block_to_append(
create_time=create_time, address=address, difficulty=difficulty
)

# Filter out minor blocks with greater create_time
m_header_list = [h for h in m_header_list if h.create_time <= create_time]
block.minor_block_header_list = m_header_list

coinbase_tokens = self._calculate_root_block_coinbase(
Expand Down

0 comments on commit 5310b34

Please sign in to comment.