nervosnetwork / ckb-light-client

CKB light client reference implementation
MIT License
14 stars 16 forks source link

fix: should mark fetching status as timeout when disconnect #158

Closed quake closed 9 months ago

yangby-cryptape commented 9 months ago

I updated the test to reproduce this bug.

You can rebase the commit, and update the last 2 assert with your bugfix.

With your bugfix:

-     assert_eq!(peers.get_txs_to_fetch().len(), 0);
-     assert_eq!(peers.get_headers_to_fetch().len(), 0);
+     assert_eq!(peers.get_txs_to_fetch().len(), 1);
+     assert_eq!(peers.get_headers_to_fetch().len(), 1);

p.s. I tested in my laptop.