-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #282 from YusukeShimizu/label-transaction
lnd: label the tx to make it easier to audit
- Loading branch information
Showing
9 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package labels | ||
|
||
import "fmt" | ||
|
||
const ( | ||
// peerswapLabelPattern is the pattern that peerswap uses to label on-chain transactions. | ||
peerswapLabelPattern = "peerswap -- %s(swap id=%s)" | ||
// opening is the label used for the opening transaction. | ||
opening = "Opening" | ||
// claimByInvoice is the label used for the claim by invoice transaction. | ||
claimByInvoice = "ClaimByInvoice" | ||
// claimByCoop is the label used for the claim by cooperative close transaction. | ||
claimByCoop = "ClaimByCoop" | ||
// ClaimByCsv is the label used for the claim by CSV transaction. | ||
claimByCsv = "ClaimByCsv" | ||
) | ||
|
||
// Opening returns the label used for the opening transaction. | ||
func Opening(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, opening, swapID) | ||
} | ||
|
||
// ClaimByInvoice returns the label used for the claim by invoice transaction. | ||
func ClaimByInvoice(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByInvoice, swapID) | ||
} | ||
|
||
// ClaimByCoop returns the label used for the claim by cooperative close transaction. | ||
func ClaimByCoop(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByCoop, swapID) | ||
} | ||
|
||
// ClaimByCsv returns the label used for the claim by CSV transaction. | ||
func ClaimByCsv(swapID string) string { | ||
return fmt.Sprintf(peerswapLabelPattern, claimByCsv, swapID) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters