bitcoin2graphdb 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1d06562b78c652e6851fe67843cdfe68b6f8c70
4
- data.tar.gz: e5a91baf4cc176f0a65691ad72512c76e4128952
3
+ metadata.gz: 2303b59d58b209277d63533cc25e263c046e8a5a
4
+ data.tar.gz: 5b1f7c1f96fe501de34bfcbb0b39206dfc0dae2b
5
5
  SHA512:
6
- metadata.gz: b5f47b605c6d20e350afb956bd8135fab4864d248ff40ce90fc5a511e67343a5e516f81b274f44ba1dad394bc8bd928f080a64d8a8660c86d9f9326fab8e0f55
7
- data.tar.gz: b6433babdf3902eff7c603a21cf576836c3ea2dc4c1a2005b555aaf54027ddf1dc08676fff49b7e275772e1e9d66b8d88ec41dd008575ef640eda6fc9610db12
6
+ metadata.gz: b04cb6d39b86a39cd72dccfb941c93df684eaff531be523046c3ae9efe374e40c9ba65728c7de32814a544e1dfe88d97166e2045416f4fe3e206ba2d3ec7605f
7
+ data.tar.gz: de26297d8880a9324c8e4d09421e857471b6aca5cf1098abd6060ef47f94a836e31fcf65a65e97b03ce0ab3285f371d6d2224457a616e8b7f04e8193eca89f97
data/README.md CHANGED
@@ -42,6 +42,7 @@ bitcoin2graphdb:
42
42
  port: 'Bitcoin Core server port. ex, 8332'
43
43
  host: 'Bitcoin Core server host. ex, xxx.xxx.xxx.xxx'
44
44
  sleep_interval: 600
45
+ min_block_confirmation: 2
45
46
  neo4j:
46
47
  server: 'neo4j server url. ex, http://localhost:7474'
47
48
  basic_auth:
@@ -7,6 +7,7 @@ module Bitcoin2Graphdb
7
7
  def open(config)
8
8
  self.provider = BlockchainProvider.new(config)
9
9
  end
10
+
10
11
  end
11
12
 
12
13
  class BlockchainProvider
@@ -19,7 +20,9 @@ module Bitcoin2Graphdb
19
20
  end
20
21
 
21
22
  def block(block_hash)
22
- api.provider.getblock(block_hash)
23
+ b = api.provider.getblock(block_hash)
24
+ raise OpenAssets::Provider::ApiError.new('{"code"=>-8, "message"=>"Block height out of range"}') if b['confirmations'] < min_block_confirmation
25
+ b
23
26
  end
24
27
 
25
28
  def block_hash(block_height)
@@ -34,6 +37,11 @@ module Bitcoin2Graphdb
34
37
  api.get_outputs_from_txid(txid, true)
35
38
  end
36
39
 
40
+ private
41
+ def min_block_confirmation
42
+ api.config[:min_block_confirmation] ? api.config[:min_block_confirmation] : 2
43
+ end
44
+
37
45
  end
38
46
  end
39
47
  end
@@ -1,3 +1,3 @@
1
1
  module Bitcoin2Graphdb
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bitcoin2graphdb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - azuchi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-05 00:00:00.000000000 Z
11
+ date: 2016-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: openassets-ruby