~singpolyma/jmp-pay

6559375a13351d1867e0e1f9542b9321bd7e7de2 — Stephen Paul Weber 8 months ago 1b7a0cb
Warn and ignore no transaction error
1 files changed, 8 insertions(+), 1 deletions(-)

M bin/process_pending_btc_transactions
M bin/process_pending_btc_transactions => bin/process_pending_btc_transactions +8 -1
@@ 200,7 200,14 @@ end

done = REDIS.hgetall("pending_btc_transactions").map { |(txid, customer_id)|
	tx_hash, address = txid.split("/", 2)
	transaction = ELECTRUM.gettransaction(tx_hash)

	transaction = begin
		ELECTRUM.gettransaction(tx_hash)
	rescue Electrum::NoTransaction
		warn $!.to_s
		next
	end

	next unless transaction.confirmations >= CONFIG[:required_confirmations]

	btc = transaction.amount_for(address)