Skip to content

cancel orders if all electrum servers are down #2281

Open
@cipig

Description

@cipig

atm, when you post an order with setprice and later all electrum servers of the coin go offline (and stay offline), the order is still in orderbook... problem with that is that the order can't be filled and can lead to situations like this:
image
spread is negative, everybody tries to buy those cheap coins and everybody fails and complains that it doesn't work

so question is if mm2 can simply cancel existing orders when there are no electrum servers left

mm2 shows this in log when calling my_balance on the coin:

25 09:17:25, coins::utxo::rpc_clients::electrum_rpc::client:313] WARN [coin=BTX-segwit] Failed to send the request using active connections, trying all connections.
25 09:17:25, coins::utxo::rpc_clients::electrum_rpc::client:426] WARN [coin=BTX-segwit], Error while sending request to btx-electrumx.coinsmunity.com:50002: Transport("Failed to establish connection: Temporary(\"Couldn't connect to the electrum server: Os { code: 111, kind: ConnectionRefused, message: \\\"Connection refused\\\" }\")")

my_balance shows this as result in such cases:

{"error":"rpc:182] dispatcher_legacy:140] legacy:242] utxo_common:218] Transport: JsonRpcError { client_info: \"coin: BTX-segwit\", request: JsonRpcBatchRequest([JsonRpcRequest { jsonrpc: \"2.0\", id: 15432, method: \"blockchain.scripthash.get_balance\", params: [String(\"e17b257cd2f2af705cd39060a1c75653cc8a5f5dab9ef93d412b6af8385a8fb5\")] }, JsonRpcRequest { jsonrpc: \"2.0\", id: 15433, method: \"blockchain.scripthash.get_balance\", params: [String(\"4b50b42533ef7808385e58db1309846f223ec52308d1deff243f7424731c5191\")] }]), error: Internal(\"All servers errored: [(btx-electrumx.coinsmunity.com:50002, Transport(\\\"Failed to establish connection: Temporary(\\\\\\\"Couldn't connect to the electrum server: Os { code: 111, kind: ConnectionRefused, message: \\\\\\\\\\\\\\\"Connection refused\\\\\\\\\\\\\\\" }\\\\\\\")\\\"))]\") }"}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions