To make sure we can use the latest version of pool in LiT, we need to
make sure pool compiles against the actual v0.11.1 branch of lnd. There
were some conflicting changes to the macaroon service that didn't make
it to the branch that we need to roll back. Those changes don't affect
pool at all as we were always using the default root key ID anyway.
Since the code returned by the GRPC stream won't be the actual context
error, we must check the error code to determine whether this was the
error encountered.
Before this we would return the error directly, causing us to not send
partial reject to the server.
Since the call to connect to a peer is no longer async, a failed
connection would block and stall the whole execution logic until the
setupCtx was canceled. At that point the node we failed to connect with
would not be communicated back to the auctioneer, and we could get
matched with the same node in the next batch attempt.
This fixes that by starting the connection attempt in a go routine.
A high max batch fee rate would reserve a lot of the account balance for
fees.
Note that if the actual fee rate goes higher than the max batch fee rate
set, then the orders won't be included in the batch, and the default
must be overridden.
When poold runs in the same process as lnd (in LiT), it hooks itself into
lnd's RPC server as an external subserver. But because the user should
still be able to use the default llm macaroon, the pool daemon must be
able to validate its own macaroons as lnd's macaroon service doesn't
know the root key for it.
In this commit, we modify our connection logic to accommodate tor nodes
that wish to sell channels. If we detect a node has even a single Tor
addr, then we'll also try to connect out to the taker that we're selling
a channel to.
In this commit, we allow Tor addrs to be attached to orders. This will
allow clients to buy/sell channels using a Tor node, or a Tor-only node.
A follow up commit to this will adjust the client-side logic to have the
asker connect out to the bidder as well if the asker is behind a Tor
node.
We update to the latest lnd version that contains the new flag in
AbandonChannel that we need. Because master is now tagged with
v0.x.99-beta, we can already increase the required version in the
server.
Because we touch this file anyway, let's as well avoid a bug in
lndclient that requires a subserver macaroon to be present even if we
don't need that subserver's functionality.
As a preparation to abandon canceled channels, we first extract the
utility method to locate a channel output created in a batch from the
batch verifier into the batch itself.