diff --git a/bin/process_pending_btc_transactions b/bin/process_pending_btc_transactions index e5944b45db0ad7ea1ed2a5d03ce968fdd4c5b99e..06f48f5440f46a28377dcb1d35f34d2ac8953a9b 100755 --- a/bin/process_pending_btc_transactions +++ b/bin/process_pending_btc_transactions @@ -230,7 +230,7 @@ repo.error_handler do |e| end end -repo.map do |pending, customer_id| +done = repo.map { |pending, customer_id| next unless pending.confirmations >= CONFIG[:required_confirmations] if pending.outgoing? @@ -251,6 +251,6 @@ repo.map do |pending, customer_id| warn "No plan for #{customer_id} cannot save #{pending.txid}" end end -end +} puts done.join("\n") diff --git a/lib/pending_transaction_repo.rb b/lib/pending_transaction_repo.rb index 6d48f153a185c202e620c6d7d8bcb8a3acb3f2bc..63fc97cf3213b3a708919e35eb65260d9dbde409 100644 --- a/lib/pending_transaction_repo.rb +++ b/lib/pending_transaction_repo.rb @@ -1,18 +1,18 @@ # frozen_string_literal: true require "lazy_object" +require "forwardable" class PendingTransactionRepo class PendingTransaction + extend Forwardable + def_delegators :@tx, :tx_hash, :confirmations + def initialize(tx, address) @tx = tx @address = address end - def tx_hash - @tx.tx_hash - end - def txid "#{tx_hash}/#{@address}" end