Skip to content

Commit

Permalink
#424 transfer some btc
Browse files Browse the repository at this point in the history
  • Loading branch information
davvd committed Jun 26, 2023
1 parent 2c8424b commit b87e333
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions front/front_btc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ def referrals(log: settings.log)
settings.daemons.start('btc-transfer-to-cold', 12 * 60 * 60) do
hot = assets.all.select { |a| a[:hot] }.map { |a| a[:value] }.inject(&:+).to_f / 100_000_000
usd = (hot * price).round
if usd > settings.toggles.get('btc:hot-threshold', '2000').to_i
btc = 500.0 / price
threshold = settings.toggles.get('btc:hot-threshold', '2000').to_i
if usd > threshold
btc = (usd - threshold + 1) / price
address = assets.all.reject { |a| a[:hot] }.sample[:address]
tx = assets.pay(address, (btc * 100_000_000).to_i)
settings.telepost.spam(
Expand Down

0 comments on commit b87e333

Please sign in to comment.