BOXFoundation / boxd

Blockchain for BOX Payout
MIT License
40 stars 10 forks source link

findSplitAddr may cost too much time for using bloom filer to "ListMatchedBlockHashes" #223

Closed Jerick26 closed 5 years ago

Jerick26 commented 5 years ago

ListMatchedBlockHashes is a method in BloomFilterHolder, the bloom filter has a locker and the member entries have many lockers. ListMatchedBlockHashes is used in applyBlock and LoadUtxoByAddress. https://github.com/BOXFoundation/boxd/blob/bbc7669ea723e5f46929f388a448146c2cd1e23d/core/chain/blockchain.go#L1337

https://github.com/BOXFoundation/boxd/blob/bbc7669ea723e5f46929f388a448146c2cd1e23d/core/chain/blockchain.go#L1358 here ListMatchedBlockHashes is called twice.

Now process block, process transaction, get balance and create transaction, these business logics all have to do so complex flow and process in sequence.

xhliu commented 5 years ago

Let's talk after the meeting. Not entirely sure what the bug is.

jiaruijiang commented 5 years ago

closed https://github.com/BOXFoundation/boxd/commit/f2f8b299d2c303b2954b4ba809357987df5cfa55