loopin: mpp pre-swap probe

This commit is contained in:
Joost Jager 2020-05-29 11:27:47 +02:00
parent 456a29c523
commit c8666caf20
No known key found for this signature in database
GPG key ID: A61B9D4C393C59C7
12 changed files with 255 additions and 105 deletions

View file

@ -35,16 +35,20 @@ const (
// HTLC v2 scrips for swaps.
ProtocolVersionHtlcV2 ProtocolVersion = 5
// ProtocolVersionMultiLoopIn indicates that the client creates a probe
// invoice so that the server can perform a multi-path probe.
ProtocolVersionMultiLoopIn ProtocolVersion = 6
// ProtocolVersionUnrecorded is set for swaps were created before we
// started saving protocol version with swaps.
ProtocolVersionUnrecorded ProtocolVersion = math.MaxUint32
// CurrentRpcProtocolVersion defines the version of the RPC protocol
// CurrentRPCProtocolVersion defines the version of the RPC protocol
// that is currently supported by the loop client.
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_HTLC_V2
CurrentRPCProtocolVersion = looprpc.ProtocolVersion_MULTI_LOOP_IN
// CurrentInteranlProtocolVersionInternal defines the RPC current
// protocol in the internal representation.
// CurrentInternalProtocolVersion defines the RPC current protocol in
// the internal representation.
CurrentInternalProtocolVersion = ProtocolVersion(CurrentRPCProtocolVersion)
)

View file

@ -20,6 +20,7 @@ func TestProtocolVersionSanity(t *testing.T) {
ProtocolVersionPreimagePush,
ProtocolVersionUserExpiryLoopOut,
ProtocolVersionHtlcV2,
ProtocolVersionMultiLoopIn,
}
rpcVersions := [...]looprpc.ProtocolVersion{
@ -29,6 +30,7 @@ func TestProtocolVersionSanity(t *testing.T) {
looprpc.ProtocolVersion_PREIMAGE_PUSH_LOOP_OUT,
looprpc.ProtocolVersion_USER_EXPIRY_LOOP_OUT,
looprpc.ProtocolVersion_HTLC_V2,
looprpc.ProtocolVersion_MULTI_LOOP_IN,
}
require.Equal(t, len(versions), len(rpcVersions))