pochette 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3358945910c692a646178c3009dd5fd05aa9358
4
- data.tar.gz: ee277dd669abf57f26b0f9577aa72151fab44781
3
+ metadata.gz: 884b10e8e2920771f062658f12ccbf064aee2723
4
+ data.tar.gz: f2d7b3b2f8e361e4b211f85973d8334478d7d08f
5
5
  SHA512:
6
- metadata.gz: 8dd8f2a7c8893370730d0109b5aa564797c1e13cb2f4e5ad336f83a794f047ade9a4c3b9762207e0ad4f8dd817a5e256ee164f8163e489e9297f66f6d9ca3266
7
- data.tar.gz: a0ed76f72a993e2b871c29df9f57fbf38ec5641daedf6d37764e6cb2b4e19f405425093744c92d064ad7a262a78059c30241d2566a96c63b0f3a137655dd15e1
6
+ metadata.gz: bc840bd0c69017d11c24e6a11f4207fcd3312c38a2863a141e3dd31d6b618df134e33ceeec6d1d9faecda8a71d6713a76b17c0bfdfc64cdda607de98913a62f6
7
+ data.tar.gz: 1c52970eae5d61b82f5969fc1b79c9752e995d8aa5b6b604aa58e2bf76cea0505c197c0f08aad1bd4a6f82acec428ad3994f623decb939b6e64b0ae02e0be84d
@@ -80,12 +80,9 @@ protected
80
80
 
81
81
  # Chooses a backend to use, gives a small advantage to incumbent backend.
82
82
  def backend
83
- if @backend.nil?
84
- @last_choice_on = Time.now
85
- return @backend = @backends.sort_by(&:block_height).last
86
- end
83
+ return @backend if @backend && @last_choice_on > 10.minutes.ago
87
84
 
88
- return @backend if @last_choice_on > 10.minutes.ago
85
+ @backend ||= @backends.first
89
86
 
90
87
  @last_choice_on = Time.now
91
88
  challenger, height = @backends
@@ -1,3 +1,3 @@
1
1
  module Pochette
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pochette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nubis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-30 00:00:00.000000000 Z
12
+ date: 2015-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport