lib/txcatcher/initializer.rb in txcatcher-0.2.2 vs lib/txcatcher/initializer.rb in txcatcher-0.2.3
- old
+ new
@@ -121,10 +121,10 @@
# Connects to all bitcoin daemons listed in config
def connect_to_rpc_node
n = TxCatcher::Config.rpcnode
print "Checking #{n["name"]} RPC connection... "
TxCatcher.rpc_node = BitcoinRPC.new("http://#{n["user"]}:#{n["password"]}@#{n["host"]}:#{n["port"]}")
-
+
i = 0 # try to connect to RPC 100 times before exiting with error
until TxCatcher.current_block_height
begin
TxCatcher.current_block_height = TxCatcher.rpc_node.getblockcount
rescue Errno::ECONNREFUSED, BitcoinRPC::JSONRPCError => e