JoinMarket-Org / joinmarket

CoinJoin implementation with incentive structure to convince people to take part
398 stars 119 forks source link

Only quit when rescan is needed #584

Open raedah opened 8 years ago

raedah commented 8 years ago

Most imports are just adding new addresses that have not been previously used. Detect if a rescan is needed when importing addresses, and keep running if a rescan is not needed.

Related issues: https://github.com/JoinMarket-Org/joinmarket/issues/478 https://github.com/JoinMarket-Org/joinmarket/issues/522

chris-belcher commented 8 years ago

Could you write a bit more about how do you know if addresses are new when importing.

adlai commented 8 years ago

@raedah is this fixed by PR #586 ?

raedah commented 8 years ago

@chris-belcher What I think it would looks like is that it would be based on the index_cache. If importing addresses to reach the index_cache, then they can be assumed to be old and a quit for rescan is needed. If having to increment the index_cache, they are new, and a rescan is not needed. In the case of recovering from seed and there is no index_cache, then a rescan would be needed.

@adlai not sure yet. need to test.

AdamISZ commented 8 years ago

This goal is not technically achieved by #586 but as I think i mention in the comments there and the additions to test/test_wallets, it creates a scenario where that can be fairly easily achieved, ie just rerun sync in code without manual restart. However there are the "from raw" scenarios without index_cache where that is not yet achievable.