htlcswitch/hodl: add flag BogusSettle

This commit adds a new hodl flag "BogusSettle" which will be used to
emulate a node trying to settle back an incoming HTLC with a fake
preimage.
This commit is contained in:
Johan T. Halseth committed 2018-05-25 06:58:23 +02:00
1 parent 88670175c7
commit 71a1aae417
3 files changed
+15

No files matched your search

+8
View File
@@ -51,6 +51,10 @@ const (
// Commit drops all HTLC after any outgoing circuits have been
// opened, but before the in-memory commitment state is persisted.
Commit
// BogusSettle attempts to settle back any incoming HTLC for which we
// are the exit node with a bogus preimage.
BogusSettle
)
// String returns a human-readable identifier for a given Flag.
@@ -72,6 +76,8 @@ func (f Flag) String() string {
return "FailOutgoing"
case Commit:
return "Commit"
case BogusSettle:
return "BogusSettle"
default:
return "UnknownHodlFlag"
}
@@ -98,6 +104,8 @@ func (f Flag) Warning() string {
msg = "will not update channel state with downstream FAIL"
case Commit:
msg = "will not commit pending channel updates"
case BogusSettle:
msg = "will settle HTLC with bogus preimage"
default:
msg = "incorrect hodl flag usage"
}