txcatcher 0.1.71 → 0.1.72
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/lib/txcatcher/server.rb +14 -0
- 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: 74093f757ec54f54173a14105b6952219b8076b0
|
4
|
+
data.tar.gz: 9d38608c5c29a6f59ef90a441d16a5d529cc3a99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42172fe4d2c92f3185e4e9e744429ed6f482d82df9e77436507029c658a5fb42b048b7324d2e581acc12fb1d8604f644eb60a13c3a057156ee1a364259bd6bdc
|
7
|
+
data.tar.gz: 81b97e896aa096bb02d554ffaba8425c4f750c4c16d7ca688d9d49d12aa29b5d6c545cdb7a9d0e479aa1e7586954e28346f87622393d19aede8ac2a7a6dafbc7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.72
|
data/lib/txcatcher/server.rb
CHANGED
@@ -17,6 +17,8 @@ module TxCatcher
|
|
17
17
|
address(path)
|
18
18
|
elsif path.start_with? "/tx/send"
|
19
19
|
broadcast_tx(params["rawtx"])
|
20
|
+
elsif path.start_with? "/feerate"
|
21
|
+
feerate(params["blocks_target"] || 2)
|
20
22
|
elsif path == "/" || path.empty?
|
21
23
|
[200, {}, "TxCatcher server, #{TxCatcher::Config.rpcnode["name"]}, current_block_height: #{TxCatcher.current_block_height}"]
|
22
24
|
else
|
@@ -78,6 +80,18 @@ module TxCatcher
|
|
78
80
|
[200, {}, tx.to_json]
|
79
81
|
end
|
80
82
|
|
83
|
+
def feerate(blocks_target)
|
84
|
+
result = TxCatcher.rpc_node.estimatesmartfee(blocks_target.to_i)
|
85
|
+
|
86
|
+
# This is for older versions of bitcoind/litecoind clients
|
87
|
+
if result.to_s.include?("error")
|
88
|
+
result = TxCatcher.rpc_node.estimatefee(blocks_target.to_i)
|
89
|
+
result = { "feerate" => result, "blocks" => blocks_target}
|
90
|
+
end
|
91
|
+
|
92
|
+
[200, {}, result["feerate"].to_s]
|
93
|
+
end
|
94
|
+
|
81
95
|
end
|
82
96
|
|
83
97
|
end
|
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.72 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "txcatcher"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.72"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
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.72
|
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-01-
|
11
|
+
date: 2018-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: goliath
|