This commits adds a complement to the existing WaitPredicate
helper function, ensuring that a boolean statement remains
true for the duration of the provided timeout. This expands
our ability to do simple sanity checks where the wait-until
semantics of WaitPredicate may not be as-well suited.
Since a ChannelPoint's funding txid can now be get/set as raw bytes or
a string, we first need to check what type it's currently set to before
accessing it.
In this commit, we modify the CloseChannel to wait for both nodes to
detect that channel as being active before we attempt to close it. This
should serve to reduce many of the flakes that we’ve been seeing on
travis which were caused by node A detecting the channel as active, but
node B not, leading to a test flake under certain timing conditions.
The new function uses the recently added WaitPredicate method.
Recent changes to the funding manger’s state machine have resulted in
some additional database calls during the funding process. This has
slowed down the tests by a few ms here and there. Recent integration
test runs have begun to fail due to AssertChannelExists returning an
error as the channel hasn’t fully propagated yet. In order to remedy
this, we’ll now use WaitPredicate to poll repeatedly to ensure. This
should serve to reduce flakes encountered within the integration tests.
In this commit, we add a new helper function to the NetworkHarness
struct. This helper function serves to allow test authors to look up
pointer to an active node based on its current public key.
Each time a new node is started, its public key will be re-registered
within the global nodesByPub map.