Always store channel state when a rev is received (#201)

The way the store data currently doesn't allow for easy testing of this.
It will be improved in a later iteration.

This fixes #200.
This commit is contained in:
Pierre-Marie Padiou 2017-10-30 14:54:34 +01:00 committed by GitHub
parent 1ba311379b
commit 3be40a1fab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,7 +553,7 @@ class Channel(val nodeParams: NodeParams, wallet: EclairWallet, remoteNodeId: Pu
require(commitments1.remoteCommit.spec.htlcs.size > 0, "we must have just signed new htlcs, otherwise we would have sent our Shutdown earlier")
goto(SHUTDOWN) using store(DATA_SHUTDOWN(commitments1, localShutdown, d.remoteShutdown.get)) sending localShutdown
} else {
stay using d.copy(commitments = commitments1)
stay using store(d.copy(commitments = commitments1))
}
case Failure(cause) => handleLocalError(cause, d)
}
@ -844,7 +844,7 @@ class Channel(val nodeParams: NodeParams, wallet: EclairWallet, remoteNodeId: Pu
self ! CMD_SIGN
}
log.debug(s"received a new rev, spec:\n${Commitments.specs2String(commitments1)}")
stay using d.copy(commitments = commitments1)
stay using store(d.copy(commitments = commitments1))
case Failure(cause) => handleLocalError(cause, d)
}