lib/zold/stress/pmnts.rb in zold-stress-0.5.0 vs lib/zold/stress/pmnts.rb in zold-stress-0.5.1

- old
+ new

@@ -52,11 +52,11 @@ all = @wallets.all Tempfile.open do |f| File.write(f, @pvt.to_s) loop do source = all.sample - balance = @wallets.find(source, &:balance) + balance = @wallets.acq(source, &:balance) next if balance.negative? || balance.zero? amount = balance / all.count next if amount < Zold::Amount.new(zld: 0.0001) loop do target = all.sample @@ -77,10 +77,10 @@ [ 'taxes', 'pay', source.to_s, "--network=#{@opts['network']}", "--private-key=#{pvt}", '--ignore-nodes-absence' ] ) - if @wallets.find(source) { |w| Zold::Tax.new(w).in_debt? } + if @wallets.acq(source) { |w| Zold::Tax.new(w).in_debt? } @log.error("The wallet #{source} is in debt and we can't pay taxes") return end details = SecureRandom.uuid @stats.exec('paid', swallow: false) do