code: def init_state_from_ledger(self, state: State, ledger: Ledger, reqHandler):
          
          if state.isEmpty:
              logger.info('{} found state to be empty, recreating from '
                          'ledger'.format(self))
              for seq_no, txn in ledger.getAllTxn():
                  txn = self.update_txn_with_extra_data(txn)
                  reqHandler.updateState([txn, ], isCommitted=True)
                  state.commit(rootHash=state.headHash)
docs: If the trie is empty then initialize it by applying
          txns from ledger.