# Current Pandora Sync and Mine flow
Currently we wait for block pendingness checkup in two places:
1. While mining
2. While Downloading new blocks
### While mining:
1. a block is minned. Then it calls `writeBlockWithState`.
2. `writeBlockWithState` verifies the **BLS sign**, **notify orchestrator** and wait for **orchestrator's reply**
3. If orchestrator send `Verified` status the block is written. Otherwise we return an error.
#### How to verifyBLS, notify orchestrator and wait for orchestrator:
> for this, first pull `release/l15` branch. Goto `blockchain.go` file.
1. While the blockchain is initialized we call `pandoraBlockHashConfirmationFetcher` function in a seperate go routine. It will trigger after every 500 milliseconds and call orchestrator with a batch of pending headers that was collected within this time period.
2. It receives responses as a batch from orchestrator and feed to a feeder.
3. When we are calling `writeBlockWithState` it calls `pndHeaderFeed` to send header to the orchestrator about new header.(the reason we are using writeBlockWithState is it is called after block and header validation and it is a common point for miner and syncer)
4. if `writeBlockWithState` receives a reply from the orchestrator it will do the rest.
### While sycning:
1. Just get a batch of blocks in the `insertChain` function.
2. Do nothing with this function.
3. This function will call `writeBlockWithState` and `writeKnownBlock` functions. They will do the same thing that `How to verifyBLS, notify orchestrator and wait for orchestrator` section does.