From fb33c989939ae90869c8bf42ef09d66510eb189a Mon Sep 17 00:00:00 2001 From: FreeTrade Date: Thu, 12 Apr 2018 02:21:05 +0700 Subject: [PATCH] Update bitcoin_address.rb --- app/models/bitcoin_address.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/bitcoin_address.rb b/app/models/bitcoin_address.rb index 9de81fd..1ab4ba8 100644 --- a/app/models/bitcoin_address.rb +++ b/app/models/bitcoin_address.rb @@ -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)