mirror of
https://github.com/romanz/electrs.git
synced 2024-11-19 09:54:09 +01:00
Don't fail blockchain.headers.subscribe on initial sync
This commit is contained in:
parent
4af4bcaaf6
commit
f9c7a06ade
@ -332,7 +332,10 @@ impl Rpc {
|
||||
let map = self.index.map();
|
||||
let chain = map.chain();
|
||||
Ok(match chain.last() {
|
||||
None => bail!("empty chain"),
|
||||
None => {
|
||||
subscription.tip = Some(BlockHash::default());
|
||||
json!({}) // no tip when waiting for index sync
|
||||
}
|
||||
Some(tip) => {
|
||||
subscription.tip = Some(*tip);
|
||||
let header = serialize(map.get_by_hash(tip).unwrap());
|
||||
|
Loading…
Reference in New Issue
Block a user