Skip to content

Commit

Permalink
Update bitcoin_address.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
FreeTrade authored Apr 11, 2018
1 parent 83330a9 commit fb33c98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/bitcoin_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ class BitcoinAddress < ActiveRecord::Base
has_many :arguments, through: :signatures

def request_balance url
(Integer(Net::HTTP.get(URI.parse(url))) rescue false)
(Integer(Net::HTTP.get(URI.parse(url)).gsub('\\.', '')) rescue false)
end

def update_balance
res = request_balance("http://hodl.amit.systems:1781/ext/getbalance/#{self.bitcoin_address}").gsub('\\.', '')
res = request_balance("http://hodl.amit.systems:1781/ext/getbalance/#{self.bitcoin_address}")

if res!=false
if ( (new_balance=res.to_i) >= 0) and (new_balance != self.balance)
Expand Down

0 comments on commit fb33c98

Please sign in to comment.