sibit 0.12.4 → 0.12.5
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.
- checksums.yaml +4 -4
- data/lib/sibit/version.rb +1 -1
- data/lib/sibit.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a60738f08eff40722e87f46d4d8e16c7f59f2d2488bdb95bfee6625057bf38f3
|
|
4
|
+
data.tar.gz: a62597ee21efd55bb466316f21960df713d7ab7fc5063eb4ad721524f8a87279
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2e9a89b805345c0a8c07ccbb8325340e73d15cf518d11d2fb5bcc11796e8ba47652d05ebcb31210b497f830fcbcc7212c2ce301cbdcca2d78acc4de260fc292f
|
|
7
|
+
data.tar.gz: 174ea54310174a0f8732510e1acc9e1aae389f87fa32e31e28b2df9ca687753641ceeb91d469156913dfafeb2e49c6be87cf30705e7bb5669934f6e46f99c0f5
|
data/lib/sibit/version.rb
CHANGED
data/lib/sibit.rb
CHANGED
|
@@ -200,7 +200,7 @@ class Sibit
|
|
|
200
200
|
tx = builder.tx(
|
|
201
201
|
input_value: unspent,
|
|
202
202
|
leave_fee: true,
|
|
203
|
-
extra_fee: [f
|
|
203
|
+
extra_fee: [f, Bitcoin.network[:min_tx_fee]].max,
|
|
204
204
|
change_address: change
|
|
205
205
|
)
|
|
206
206
|
left = unspent - tx.outputs.map(&:value).inject(&:+)
|
|
@@ -267,6 +267,11 @@ class Sibit
|
|
|
267
267
|
raise Error, "Can't understand the amount #{amount.inspect}"
|
|
268
268
|
end
|
|
269
269
|
|
|
270
|
+
# Calculates a fee in satoshi for the transaction of the specified size.
|
|
271
|
+
# The +fee+ argument could be a number in satoshi, in which case it will
|
|
272
|
+
# be returned as is, or a string like "XL" or "S", in which case the
|
|
273
|
+
# fee will be calculated using the +size+ argument (which is the size
|
|
274
|
+
# of the transaction in bytes).
|
|
270
275
|
def mfee(fee, size)
|
|
271
276
|
return fee.to_i if fee.is_a?(Integer)
|
|
272
277
|
raise Error, 'Fee should either be a String or Integer' unless fee.is_a?(String)
|