txcatcher 0.1.92 → 0.1.93
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/txcatcher-monitor +29 -7
- data/txcatcher.gemspec +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4736918a4d5ce4b459d1fe6b7c13599b761ae9a
|
4
|
+
data.tar.gz: d2c55d4de1e480a521b94e196e893a5e80107bf8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 844452261a87b9ebafc4e9b1989e0adcc0df7e199e0aa1dd6aed2bf6e12f736b455c36df6434066ec862f78f7a8f1f64ce1f62d9a80f1bead62f89cea70a4831
|
7
|
+
data.tar.gz: b2fa81ebe3a22f05e7f721284eb1498585b652039aef84f9f3fdac06072acfdfcd03636508760abadcc93dc9fff3d441d0a93883cc099f6388eed18345fb6043
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.93
|
data/bin/txcatcher-monitor
CHANGED
@@ -78,15 +78,34 @@ end
|
|
78
78
|
|
79
79
|
def latest_output_addr(i=0)
|
80
80
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
txs = nil
|
82
|
+
attempts = 0
|
83
|
+
until txs || attempts > 10
|
84
|
+
attempts += 1
|
85
|
+
begin
|
86
|
+
response = Faraday.get do |req|
|
87
|
+
req.url TxCatcher::Config["monitor"]["blockchain_source_url"]
|
88
|
+
req.options.timeout = 5
|
89
|
+
req.options.open_timeout = 5
|
90
|
+
end
|
91
|
+
rescue StandardError => e
|
92
|
+
LOGGER.report(e, :error, data: { attempt: attempts })
|
93
|
+
if attempts >= 10
|
94
|
+
send_alert(
|
95
|
+
"TxCatcher monitor error",
|
96
|
+
"Tried fetching new txs from #{TxCatcher::Config["monitor"]["blockchain_source_url"]}, got the following error\n\n" +
|
97
|
+
"#{e.to_s}\n\n#{e.backtrace.join("\n")}"
|
98
|
+
)
|
99
|
+
return nil
|
100
|
+
else
|
101
|
+
sleep 15
|
102
|
+
end
|
103
|
+
end
|
104
|
+
txs = JSON.parse(response.body) if response
|
85
105
|
end
|
86
|
-
txs = JSON.parse(response.body)
|
87
106
|
|
88
107
|
txs.each do |tx|
|
89
|
-
if tx["outputs"] && tx["outputs"][i]["addresses"]
|
108
|
+
if tx["outputs"] && tx["outputs"][i] && tx["outputs"][i]["addresses"]
|
90
109
|
tx["outputs"][i]["addresses"].each do |addr|
|
91
110
|
# Blockcypher returns old Litecoin P2SH addresses which start with 3, which
|
92
111
|
# txcatcher doesn't support. Let's just ignore them.
|
@@ -127,6 +146,9 @@ response = nil
|
|
127
146
|
attempts = 0
|
128
147
|
addr = nil
|
129
148
|
while attempts < 3 && (response.nil? || response.empty?)
|
149
|
+
|
150
|
+
url = TxCatcher::Config["monitor"]["txcatcher_url"] + "/addr/#{addr}/utxo"
|
151
|
+
|
130
152
|
attempts += 1
|
131
153
|
begin
|
132
154
|
|
@@ -134,11 +156,11 @@ while attempts < 3 && (response.nil? || response.empty?)
|
|
134
156
|
addr_index = 0
|
135
157
|
begin
|
136
158
|
a = latest_output_addr(addr_index)
|
159
|
+
exit unless a # error already sent in latest_output_addr, so just exit.
|
137
160
|
addr_index += 1
|
138
161
|
end until addr != a || addr_index > 5
|
139
162
|
addr = a
|
140
163
|
|
141
|
-
url = TxCatcher::Config["monitor"]["txcatcher_url"] + "/addr/#{addr}/utxo"
|
142
164
|
response = fetch_txcatcher_response(addr)
|
143
165
|
|
144
166
|
if response.empty?
|
data/txcatcher.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: txcatcher 0.1.
|
5
|
+
# stub: txcatcher 0.1.93 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "txcatcher".freeze
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.93"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: txcatcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.93
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Snitko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04
|
11
|
+
date: 2018-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: goliath
|