#NEWLINE# @ classmethod #NEWLINE# def get_xfer_affecting_inputs( cls , tx , padding , out_index ) : #NEWLINE# #INDENT# '\n        Returns a set of indices that correspond to the inputs\n        for an output in the transaction tx with output index out_index\n        which has a padding of padding (2^n for some n>0 or 0).\n        ' #NEWLINE# tx . ensure_input_values ( ) #NEWLINE# out_prec_sum = 0 #NEWLINE# for oi in range ( out_index ) : #NEWLINE# #INDENT# value_wop = ( tx . outputs [ oi ] . value - padding ) #NEWLINE# if ( value_wop <= 0 ) : #NEWLINE# #INDENT# return set ( ) #NEWLINE# #UNINDENT# out_prec_sum += value_wop #NEWLINE# #UNINDENT# out_value_wop = ( tx . outputs [ out_index ] . value - padding ) #NEWLINE# if ( out_value_wop <= 0 ) : #NEWLINE# #INDENT# return set ( ) #NEWLINE# #UNINDENT# affecting_inputs = set ( ) #NEWLINE# input_running_sum = 0 #NEWLINE# for ( ii , inp ) in enumerate ( tx . inputs ) : #NEWLINE# #INDENT# prev_tag = cls . get_tag ( inp . prevtx ) #NEWLINE# if ( not prev_tag ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# value_wop = ( tx . inputs [ ii ] . value - prev_tag . get_padding ( ) ) #NEWLINE# if ( value_wop <= 0 ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( ( input_running_sum < ( out_prec_sum + out_value_wop ) ) and ( ( input_running_sum + value_wop ) > out_prec_sum ) ) : #NEWLINE# #INDENT# affecting_inputs . add ( ii ) #NEWLINE# #UNINDENT# input_running_sum += value_wop #NEWLINE# #UNINDENT# return affecting_inputs