#NEWLINE# def handle_queries( self , queries ) : #NEWLINE# #INDENT# def create_response( address ) : #NEWLINE# #INDENT# self . address = address #NEWLINE# fields = { #NEWLINE# #INDENT# 'lbrycrd_address' : address , #NEWLINE# #UNINDENT# } #NEWLINE# return fields #NEWLINE# #UNINDENT# if ( self . query_identifiers [ 0 ] in queries ) : #NEWLINE# #INDENT# d = self . wallet . get_new_address_for_peer ( self . peer ) #NEWLINE# d . addCallback ( create_response ) #NEWLINE# return d #NEWLINE# #UNINDENT# if ( self . address is None ) : #NEWLINE# #INDENT# log . warning ( 'Expected a request for an address, but did not receive one' ) #NEWLINE# return defer . fail ( Failure ( ValueError ( 'Expected but did not receive an address request' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return defer . succeed ( { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )