We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0c248cb commit 85097d6Copy full SHA for 85097d6
lib/bitcoin/builder.rb
@@ -173,12 +173,13 @@ def output
173
# case to specify a tx fee that should be left unclaimed by the
174
# change output.
175
def tx opts = {}
176
+ return @tx if @tx.hash
177
+
178
if opts[:change_address] && !opts[:input_value]
179
raise "Must give 'input_value' when auto-generating change output!"
180
end
181
@ins.each {|i| @tx.add_in(i.txin) }
182
@outs.each {|o| @tx.add_out(o.txout) }
-
183
if opts[:change_address]
184
output_value = @tx.out.map(&:value).inject(:+)
185
change_value = opts[:input_value] - output_value
0 commit comments