<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_bitcoind_info(self):
 """ Get bitcoind info. Try the cache, and on cache miss, fetch from bitcoind and cache. """

        cached_bitcoind_info = self.get_cached_bitcoind_info()
        if cached_bitcoind_info:
            return cached_bitcoind_info

        bitcoind_opts = default_bitcoind_opts( virtualchain.get_config_filename(virtualchain_hooks, self.working_dir), prefix=True )
        bitcoind = get_bitcoind( new_bitcoind_opts=bitcoind_opts, new=True )

        if bitcoind is None:
            return {'error': 'Internal server error: failed to connect to bitcoind'}
        
        try:
            info = bitcoind.getinfo()
            assert 'error' not in info
            assert 'blocks' in info

            self.set_cached_bitcoind_info(info)
            return info

        except Exception as e:
            raise