lnwallet: remove the closeObserver from the channel state machine

In this PR, we entirely remove the closeObserver from the channel state
machine. It was added very early on before most of the other aspects of
the daemon were built out. This goroutine was responsible for
dispatching notifications to outside parties if the commitment
transaction was spent at all. This had several issues, since it was
linked to the *lifetime* of the channel state machine itself. As a
result of this linkage, we had to do weird stuff like hand off in
memory pointers to the state machine in order to ensure notifications
were properly dispatched.
This commit is contained in:
Olaoluwa Osuntokun
2018-01-18 13:45:30 -08:00
parent b391049e49
commit 30c4196f91
5 changed files with 141 additions and 738 deletions

View File

@@ -73,10 +73,10 @@ func TestCommitmentSpendValidation(t *testing.T) {
// This is Alice's commitment transaction, so she must wait a CSV delay
// of 5 blocks before sweeping the output, while bob can spend
// immediately with either the revocation key, or his regular key.
keyRing := &commitmentKeyRing{
delayKey: aliceDelayKey,
revocationKey: revokePubKey,
noDelayKey: bobPayKey,
keyRing := &CommitmentKeyRing{
DelayKey: aliceDelayKey,
RevocationKey: revokePubKey,
NoDelayKey: bobPayKey,
}
commitmentTx, err := CreateCommitTx(*fakeFundingTxIn, keyRing, csvTimeout,
channelBalance, channelBalance, DefaultDustLimit())