Closed yangby-cryptape closed 7 months ago
At present, only one set of verified last N block headers are cached.
https://github.com/nervosnetwork/ckb-light-client/blob/0a8c34ab0db24c8d3af53a894efb1a443ea7cae4/src/protocols/light_client/peers.rs#L23-L24
But, in fact, all peers could have different sets of last N block headers.
Consider that:
N
N+k
What will be happened?
Traverse last headers of all peers every time.
Description
At present, only one set of verified last N block headers are cached.
https://github.com/nervosnetwork/ckb-light-client/blob/0a8c34ab0db24c8d3af53a894efb1a443ea7cae4/src/protocols/light_client/peers.rs#L23-L24
But, in fact, all peers could have different sets of last N block headers.
Consider that:
N
.N+k
.What will be happened?
How to fix that?
Traverse last headers of all peers every time.
Commits