lib/mastercoin-wallet/builder.rb in mastercoin-wallet-0.0.6 vs lib/mastercoin-wallet/builder.rb in mastercoin-wallet-0.0.7
- old
+ new
@@ -108,16 +108,12 @@
def pick_outputs(required_amount)
used_outputs = MastercoinWallet.config.created_transactions.collect{|x| x["in"][0]["prev_out"] }
usuable_outputs = MastercoinWallet.config.spendable_outputs.find{|x| BigDecimal.new(x[:value]) > BigDecimal.new(required_amount.to_s) }
- #puts "Found these total: #{usuable_outputs}"
- #puts "These are used #{used_outputs}"
-
usuable_outputs = [usuable_outputs] if usuable_outputs.is_a?(Hash)
usuable_outputs.reject!{|x| puts x; used_outputs.include?(x["prev_out"])}
- #puts "Left with these: #{usuable_outputs}"
if usuable_outputs.empty?
# Outputs are saved in order so the last output should always the one that's unused, make sure it's an output for thist address and that it's big enough
if MastercoinWallet.config.created_transactions.last["out"].first["address"] == MastercoinWallet.config.address && MastercoinWallet.config.created_transactions.last["out"].first["value"].to_f >= BigDecimal.new(required_amount)
# We are taking an full transaction and building a spendable output based on the details we have
@@ -264,15 +260,9 @@
return
else
sent_transactions = MastercoinWallet.config.get_key("created_transactions")
sent_transactions ||= []
sent_transactions << tx.to_hash(with_address: true)
-
- #transactions = MastercoinWallet.config.get_key("bitcoin_transactions")
- #transactions ||= []
- #transactions << tx
- #transactions = MastercoinWallet.config.set_key!("bitcoin_transactions", transactions)
-
MastercoinWallet.config.set_key!(:created_transactions, sent_transactions)
Qt::MessageBox.information(self, tr("Transaction send"),
tr("Your transaction with hash #{tx.to_hash["hash"]} has been offered to the relay server, it should show up within 10 minutes."))