def chain_difficulty
      return difficulty if genesis?

      k = "difficulty:#{Utils.encode_hex(full_hash)}"
      return Utils.decode_int(db.get(k)) if db.has_key?(k)

      o = difficulty + get_parent.chain_difficulty
      @state.db.put_temporarily k, Utils.encode_int(o)
      o
    end
def chain_difficulty
      return difficulty if genesis?

      k = "difficulty:#{Utils.encode_hex(full_hash)}"
      return Utils.decode_int(db.get(k)) if db.has_key?(k)

      o = difficulty + get_parent.chain_difficulty
      @state.db.put_temporarily k, Utils.encode_int(o)
      o
    end
Get the summarized difficulty.

 If the summarized difficulty is not stored in the database, it will be
 calculated recursively and put int the database.