nervosnetwork / ckb-light-client

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

fix: resolve update script block number error #165

Closed quake closed 8 months ago

quake commented 8 months ago

we are using the matched_blocks lock to avoiding concurrent update scrtips' filtered block number: https://github.com/nervosnetwork/ckb-light-client/blob/89be07042a7d01688ebac89b1c7b2c56bec791b6/src/service.rs#L403

however, the lock scope is too small when processing the BlockFilters message, it results in concurrent updates to the same scripts' filtered block number: https://github.com/nervosnetwork/ckb-light-client/blob/89be07042a7d01688ebac89b1c7b2c56bec791b6/src/protocols/filter/components/block_filters_process.rs#L215