lib/mastercoin-wallet/builder.rb in mastercoin-wallet-0.0.11 vs lib/mastercoin-wallet/builder.rb in mastercoin-wallet-0.0.12

- old
+ new

@@ -108,9 +108,15 @@ 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) } + unless usuable_outputs + Qt::MessageBox.critical(self, tr("Could not send transaction"), + tr("It appears there are no spendable outputs for this address that are big enough to transmit this transaction. Please consolidate some coins and send them to your Mastercoin address.")) + return + end + usuable_outputs = [usuable_outputs] if usuable_outputs.is_a?(Hash) usuable_outputs.reject!{|x| puts x; used_outputs.include?(x["prev_out"])} 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