1
0
Fork 0
mirror of https://github.com/romanz/electrs.git synced 2025-02-24 15:02:21 +01:00

Use faster headers' download during initialization

This commit is contained in:
Roman Zeyde 2018-06-09 18:13:20 +03:00
parent b9b7babf79
commit 32768b128b
No known key found for this signature in database
GPG key ID: 87CAE5FA46917CBB

View file

@ -341,6 +341,9 @@ impl Daemon {
bestblockhash: &Sha256dHash,
) -> Result<Vec<BlockHeader>> {
// Iterate back over headers until known blockash is found:
if indexed_headers.len() == 0 {
return self.get_all_headers(bestblockhash);
}
let mut new_headers = vec![];
let null_hash = Sha256dHash::default();
let mut blockhash = *bestblockhash;