htlcswitch: add new ProcessContractResolution method

In this commit, we add a new method: ProcessContractResolution. This
will be used by entities of the contract court package to notify us
whenever they discover that we can resolve an incoming contract
off-chain after the outgoing contract was fully resolved on-chain.

We’ll take a contractcourt.ResolutionMsg and map it to the proper
internal package so we can fully resolve an active circuit.
This commit is contained in:
Olaoluwa Osuntokun
2018-01-16 20:11:01 -08:00
parent 8807d1d752
commit 9cb3657314
3 changed files with 110 additions and 5 deletions

View File

@@ -46,4 +46,11 @@ type htlcPacket struct {
// of a forwarded fail packet are already set and do not need to be looked
// up in the circuit map.
isRouted bool
// isResolution is set to true if this packet was actually an incoming
// resolution message from an outside sub-system. We'll treat these as
// if they emanated directly from the switch. As a result, we'll
// encrypt all errors related to this packet as if we were the first
// hop.
isResolution bool
}