onchain 1.0.6 → 1.0.7

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/payments.rb +6 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7b3fb3cb1af44f4f907f75f9a156928150ff520
4
- data.tar.gz: 62b30591c6eea183a2c904c6dac349947bbf9123
3
+ metadata.gz: 629b71f135f95cd791eb7417c36112af9bc496fb
4
+ data.tar.gz: 90de470917841e0b0fe67aa35c7803833f8e0ce9
5
5
  SHA512:
6
- metadata.gz: 2542f668514e9b95a9a6c5d5af6bf5c68c0b603f35395b9b7119ebf83f44b2f201e3df77320c078b75fc6c432222bd5e019f404b71150e2305123d36675d6c1c
7
- data.tar.gz: 930f57d3e7f6f4ec79f7d19062b28a86557c3d9d6021466807a5080238587658dc0ae224b413522e3c97a41fda03cf4bf0a473b61c85208bb404b70ceb3dadec
6
+ metadata.gz: b97b5063e7cc8981d97c8d2dadd08de067851ee091d083baaa17cd502075b68ac1a752163d55acd01f0a3d91d8bf248b01a6d54b2281a4acfab82bf4a7e6abe2
7
+ data.tar.gz: e20f39a38806722413e59959035fbe8b8c6a2236f826dcf1f52787a96f7a2047746aee1e1e184caa8de02b14d791b338e4741518616b2ec4e18fd2389523b26a
@@ -30,18 +30,18 @@ class OnChain
30
30
  amount_so_far = 0
31
31
  unspent = get_unspent_outs(fund_address)
32
32
  unspent.each do |spent|
33
-
34
- amount_so_far = amount_so_far + spent[3].to_i
35
- if amount_so_far >= total_amount
36
- next
37
- end
38
-
33
+
39
34
  txin = Bitcoin::Protocol::TxIn.new
40
35
 
41
36
  txin.prev_out = spent[0]
42
37
  txin.prev_out_index = spent[1]
43
38
 
44
39
  tx.add_in(txin)
40
+
41
+ amount_so_far = amount_so_far + spent[3].to_i
42
+ if amount_so_far >= total_amount
43
+ next
44
+ end
45
45
  end
46
46
  change = amount_so_far - total_amount
47
47
 
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.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Purton