onchain 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/onchain/sweeper.rb +12 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cf73ab623ae375506f45754de4e130a1a0d093a
|
4
|
+
data.tar.gz: db09832037614a23a8ec38d2cfb431af194e7601
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8a4fd056fc81aaad15b404f8364171c4bca58c4ca9bb4d6b066df37ab5ed3d42372838e8aceb81d2cfdfe9c367d5ff98d33e3af09034f4bc585fe6b52f298eb
|
7
|
+
data.tar.gz: 60bd8043624a405e2b04983b6331f9def47dacff55a4c88e177334c5ff2c91d423a2d47ef08725e0ffab85078b1051efafb6e628ae747e09418d217b1eb82550
|
data/lib/onchain/sweeper.rb
CHANGED
@@ -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
|
-
|
67
|
-
|
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
|