Warn and ignore no transaction error

Stephen Paul Weber created

Change summary

bin/process_pending_btc_transactions | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

Detailed changes

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)