andrewroth-btce 0.1.9.3 → 0.1.9.4
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.
- data/lib/btce.rb +8 -4
- metadata +1 -1
data/lib/btce.rb
CHANGED
@@ -283,10 +283,14 @@ module Btce
|
|
283
283
|
end
|
284
284
|
|
285
285
|
def nonce
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
286
|
+
File.open("btce-nonce", "a+") do |f|
|
287
|
+
f.flock(File::LOCK_EX)
|
288
|
+
@nonce = f.read.to_i
|
289
|
+
@nonce += 1
|
290
|
+
f.truncate(0)
|
291
|
+
f.puts(@nonce)
|
292
|
+
end
|
293
|
+
return Time::now.to_i + @nonce
|
290
294
|
end
|
291
295
|
private :nonce
|
292
296
|
|