Skip to content

Commit

Permalink
remove float and add another check for dupe provers (#1817)
Browse files Browse the repository at this point in the history
* remove float and add another check for dupe provers

* going back to float for now

* Try to fix flaky test

Co-authored-by: Bill Blanke <wjb2002@flex.com>
Co-authored-by: Mariano <sorgente711@gmail.com>
  • Loading branch information
3 people committed Apr 12, 2021
1 parent 120b43e commit 6d22878
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions chia/plotting/plot_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,9 @@ def load_plots(
log.error(f"Failed to open file {filename}. {e}")
continue
if stat_info.st_mtime == provers[filename].time_modified:
if provers[filename].prover.get_id() in plot_ids:
log.warning(f"Have multiple copies of the plot {filename}, not adding it.")
continue
total_size += stat_info.st_size
new_provers[filename] = provers[filename]
plot_ids.add(provers[filename].prover.get_id())
Expand Down
6 changes: 3 additions & 3 deletions tests/core/server/test_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ async def test_spam_tx(self, setup_two_nodes):
# Remove outbound rate limiter to test inbound limits
ws_con.outbound_rate_limiter = RateLimiter(percentage_of_limit=10000)

for i in range(6000):
for i in range(10000):
await ws_con._send_message(new_tx_message)
await asyncio.sleep(1)

def is_closed():
return ws_con.closed

await time_out_assert(15, is_closed)
await time_out_assert(30, is_closed)

assert ws_con.closed

def is_banned():
return "1.2.3.4" in server_2.banned_peers

await time_out_assert(15, is_banned)
await time_out_assert(30, is_banned)

@pytest.mark.asyncio
async def test_spam_message_non_tx(self, setup_two_nodes):
Expand Down

0 comments on commit 6d22878

Please sign in to comment.