txcatcher 0.2.12 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/lib/txcatcher/catcher.rb +4 -2
- data/lib/txcatcher/cleaner.rb +1 -1
- data/lib/txcatcher/initializer.rb +3 -3
- data/lib/txcatcher/logger.rb +2 -2
- data/lib/txcatcher/models/transaction.rb +2 -2
- data/txcatcher.gemspec +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38bad27a4120b50cb51ce9071239676b1219f1177ab977090b1e57a192b8ac66
|
4
|
+
data.tar.gz: 187e7f7905bee995a8ac341d899d7d7cf00efbd05b5f32696f82f456dc8d024d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe46bcb16a750f4a03aa77f0034fac4fc8e072ce7960b8ce3a4ad82ea361b2a5464908b7d2ca2e0a6b5a9bccf98447a018e968b90b6b6eced1c20d64ecf5ba12
|
7
|
+
data.tar.gz: 97cbcab71ce183f75675e074a474af8824a9757242d4a1e5e02e6135b54950ae9c3e1e6a5d5bc47272951faf7488d97ab3ff2d5d4bcec3e5e0d068737280e2cd
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.14
|
data/lib/txcatcher/catcher.rb
CHANGED
@@ -105,8 +105,10 @@ module TxCatcher
|
|
105
105
|
undetected_transactions_ids = block_transactions_ids - existing_transactions_ids
|
106
106
|
undetected_transactions_ids.each { |txid| Transaction.create_from_rpc(txid) }
|
107
107
|
Transaction.where(txid: existing_transactions_ids).update(block_height: height)
|
108
|
-
|
109
|
-
|
108
|
+
})
|
109
|
+
# Update RBF transactions and deposits if a transaction a with lower fee
|
110
|
+
# (no associated deposit) got accidentally confirmed.
|
111
|
+
@queue["hashblock"] << (Proc.new {
|
110
112
|
TxCatcher::Transaction.where(block_height: height).exclude(rbf_next_transaction_id: nil).each do |t|
|
111
113
|
t.force_deposit_association_on_rbf!
|
112
114
|
end
|
data/lib/txcatcher/cleaner.rb
CHANGED
@@ -51,7 +51,7 @@ module TxCatcher
|
|
51
51
|
|
52
52
|
def clean_transactions(n)
|
53
53
|
transactions = Transaction.order(Sequel.asc(:created_at))
|
54
|
-
transactions.where(Sequel.~(protected: true)) if Config.protected_transactions
|
54
|
+
transactions = transactions.where(Sequel.~(protected: true)) if Config.protected_transactions
|
55
55
|
|
56
56
|
t = n/100
|
57
57
|
t = 1 if t == 0
|
@@ -105,15 +105,15 @@ module TxCatcher
|
|
105
105
|
"#{File.dirname(ConfigFile.path)}/#{db_config[:db_path]}"
|
106
106
|
end
|
107
107
|
else
|
108
|
-
db_config[:db_name]
|
108
|
+
db_config[:db_path] || db_config[:db_name]
|
109
109
|
end
|
110
110
|
|
111
111
|
TxCatcher.db_connection = Sequel.connect(
|
112
112
|
"#{db_config[:adapter]}://" +
|
113
113
|
"#{db_config[:user]}#{(":" if db_config[:user])}" +
|
114
114
|
"#{db_config[:password]}#{("@" if db_config[:user] || db_config[:password])}" +
|
115
|
-
"#{db_config[:host]
|
116
|
-
"
|
115
|
+
"#{db_config[:host] || "localhost"}" +
|
116
|
+
":#{db_config[:port]}#{("/" if db_config[:host] || db_config[:port])}" +
|
117
117
|
"#{db_name}"
|
118
118
|
)
|
119
119
|
end
|
data/lib/txcatcher/logger.rb
CHANGED
@@ -30,7 +30,7 @@ module TxCatcher
|
|
30
30
|
|
31
31
|
private
|
32
32
|
|
33
|
-
def report_to_stdout(message, log_level, data: nil, timestamp:
|
33
|
+
def report_to_stdout(message, log_level, data: nil, timestamp: false, newline: "\n")
|
34
34
|
$stdout.print prepare_message(message, timestamp: timestamp)
|
35
35
|
$stdout.print "\n additional data: #{data.to_s}" if data
|
36
36
|
if LOG_LEVELS[log_level] >= LOG_LEVELS[:error]
|
@@ -55,7 +55,7 @@ module TxCatcher
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def report_to_sentry(e, log_level, data: nil, timestamp:
|
58
|
+
def report_to_sentry(e, log_level, data: nil, timestamp: false, newline: true)
|
59
59
|
return unless TxCatcher::Config["logger"]["sentry_dsn"]
|
60
60
|
data ||= {}
|
61
61
|
data.merge!(environment: Config["environment"], host: Config["host"], currency: Config["currency"])
|
@@ -193,7 +193,7 @@ module TxCatcher
|
|
193
193
|
d.rbf_transaction_ids.push(d.transaction_id)
|
194
194
|
d.transaction_id = self.id
|
195
195
|
d.save
|
196
|
-
end
|
196
|
+
end if tx
|
197
197
|
end
|
198
198
|
|
199
199
|
def to_json
|
@@ -225,7 +225,7 @@ module TxCatcher
|
|
225
225
|
def validate
|
226
226
|
super
|
227
227
|
validates_unique :txid
|
228
|
-
errors.add(:base, "Duplicate transaction listed as RBF") if self.rbf_previous_transaction&.txid && self&.txid && self.rbf_previous_transaction&.txid == self&.txid
|
228
|
+
#errors.add(:base, "Duplicate transaction listed as RBF") if self.rbf_previous_transaction&.txid && self&.txid && self.rbf_previous_transaction&.txid == self&.txid
|
229
229
|
errors.add(:base, "No outputs for this transaction") if !self.rbf? && self.deposits.empty?
|
230
230
|
end
|
231
231
|
|
data/txcatcher.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "txcatcher".freeze
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.14"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
6
6
|
s.require_paths = ["lib".freeze]
|
7
7
|
s.authors = ["Roman Snitko".freeze]
|
8
8
|
s.date = "2018-10-02"
|
9
|
-
s.description = "
|
9
|
+
s.description = "Currently, the only job of this gem is to collect all new Bitcoin/Litecoin transactions, store them in a DB, index addresses.".freeze
|
10
10
|
s.email = "roman.snitko@gmail.com".freeze
|
11
11
|
s.executables = ["txcatcher".freeze, "txcatcher-monitor".freeze]
|
12
12
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: txcatcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Snitko
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
description:
|
139
|
+
description: Currently, the only job of this gem is to collect all new Bitcoin/Litecoin
|
140
140
|
transactions, store them in a DB, index addresses.
|
141
141
|
email: roman.snitko@gmail.com
|
142
142
|
executables:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
209
|
+
rubygems_version: 3.1.2
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: An lightweight version of Bitpay's Insight, allows to check Bitcoin/Litecoin
|