onchain 1.1.8 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/onchain/sweeper.rb +12 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3d1afa67290306977f3fdbdcdbf501dc39941f09
4
- data.tar.gz: 2d4c4c3a88040b23e9830930330e986515486f3d
3
+ metadata.gz: 5cf73ab623ae375506f45754de4e130a1a0d093a
4
+ data.tar.gz: db09832037614a23a8ec38d2cfb431af194e7601
5
5
  SHA512:
6
- metadata.gz: 7afe5e34552e43ce01496792bc1785e1e5e7c7757ffa8ad49d51abcfdcc6f71826830860ef05988861802053e6ae7c721a729a4bc40102b9fdb0c716e3004a5b
7
- data.tar.gz: 6428a5b15ec8671dfa812c2c49a57e93c6e245f0bf7214d177771fa354f1c1170311ee87a7130f0655f1eb9c5e574d8189c44e08d81917b5dad60a9094f05f78
6
+ metadata.gz: e8a4fd056fc81aaad15b404f8364171c4bca58c4ca9bb4d6b066df37ab5ed3d42372838e8aceb81d2cfdfe9c367d5ff98d33e3af09034f4bc585fe6b52f298eb
7
+ data.tar.gz: 60bd8043624a405e2b04983b6331f9def47dacff55a4c88e177334c5ff2c91d423a2d47ef08725e0ffab85078b1051efafb6e628ae747e09418d217b1eb82550
@@ -59,12 +59,21 @@ class OnChain::Sweeper
59
59
  incoming_coins = []
60
60
 
61
61
  to_sweep.each do |address, path|
62
+
62
63
  txs = Chain.get_address_transactions(address)
63
64
 
64
65
  txs.each do |tx|
65
66
 
66
- if tx["block_height"].to_i > last_block_checked
67
- addresses = tx["outputs"]["addresses"]
67
+ block_height = tx["block_height"].to_i
68
+ if block_height > last_block_checked
69
+
70
+ tx["outputs"].each do |output|
71
+ output["addresses"].each do |address|
72
+ if to_sweep[address] != nil
73
+ incoming_coins << [address, to_sweep[address], output["value"]]
74
+ end
75
+ end
76
+ end
68
77
 
69
78
  else
70
79
  break
@@ -72,7 +81,7 @@ class OnChain::Sweeper
72
81
 
73
82
  end
74
83
  end
75
-
84
+ return incoming_coins
76
85
  end
77
86
 
78
87
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onchain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Purton