This commit adds a goroutine watchChannelStatus to the server, which
will query the switch for the status of all open channels every
InactiveChanTimeout / 4. If a channel's status has remained unchanged
during the last InactiveChanTimeout it'll send out a ChannelUpdate
setting the disabled bit accordingly.
This commit changes the test testSendUpdateDisableChannel to use Dave to
listen for channel updates, as was originally intended.
Since a ChannelUpdate won't propagate in the network if the channel is
already closed (if the closing transaction has been mined), we change
the closing procedure to initiate the closing process, wait for the
ChannelUpdates, then finally mining the closing transaction. This avoids
a propagation race between the mined block and the ChannelUpdate.
ProcessLocalAnnouncement will attempt to call UpdateEdge with the new
policy. If we call it manually before handing it to the gossiper, that
call will fail with "Outdated" and the announcement won't propagate.
This commit fixes a small bug that could cause us to disconnect an
already connected peer if no addresses where provided to the ConnectPeer
method. Now we instead first check if we are already connected, and
return early.
In this commit, we add a new method to the network harness that allows
us to send funds to another party without confirming the transaction.
This will be useful for testing funding channels with outputs that have
not been confirmed yet.
In this commit, we alter our mock heuristic to also take in a quit chan.
It's possible that at the end of a test the agent is blocked on a
NeedMoreChans/Select call as their mock implementations use channels. To
prevent this, we use the agent's quit chan so that the heuristic can
safely exit once the agent does.
In this commit, we refactor the existing connection logic outside of the
ChanController's OpenChannel method. We do this as previously it was
possible for peers to stall us while attempting to connect to them. In
order to remedy this, we now attempt to connect the peer before tracking
them in our set of pending opens.
In this commit, we add a new test to expose a lurking bug within the
graph database code. As is, when we go to delete a node from the
database, we don't also remove the entries within the update index. As a
result, if a user attempted to call NodeUpdatesInHorizon (or typically
as part of the p2p handshake), we would error out, as we would try to
read a node that no longer existed in the graph, as it was pruned.
In this commit, we fix a bug where it's possible that changing the
wallet's password fails due to not being able to remove non-existent
macaroon files. Since it's possible to run lnd without creating them,
changing the wallet's password would always result in a failure.