From 6559375a13351d1867e0e1f9542b9321bd7e7de2 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 17 Jan 2024 10:51:22 -0500 Subject: [PATCH] Warn and ignore no transaction error --- bin/process_pending_btc_transactions | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/process_pending_btc_transactions b/bin/process_pending_btc_transactions index bae2cba..460329b 100755 --- a/bin/process_pending_btc_transactions +++ b/bin/process_pending_btc_transactions @@ -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) -- 2.45.2