mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-27 14:11:04 +02:00
multi: add labels to lnd native transactions
Follow up labelling of external transactions with labels for the transaction types we create within lnd. Since these labels will live a life of string matching, a version number and rigid format is added so that string matching is less painful. We start out with channel ID, where available, and a transaction "type". External labels, added in a previous PR, are not updated to this new versioned label because they are not lnd-initiated transactions. Label matching can check this case, then check for a version number.
This commit is contained in:
@@ -2,6 +2,7 @@ package lookout
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/labels"
|
||||
)
|
||||
|
||||
// PunisherConfig houses the resources required by the Punisher.
|
||||
@@ -42,7 +43,8 @@ func (p *BreachPunisher) Punish(desc *JusticeDescriptor, quit <-chan struct{}) e
|
||||
log.Infof("Publishing justice transaction for client=%s with txid=%s",
|
||||
desc.SessionInfo.ID, justiceTxn.TxHash())
|
||||
|
||||
err = p.cfg.PublishTx(justiceTxn, "")
|
||||
label := labels.MakeLabel(labels.LabelTypeJusticeTransaction, nil)
|
||||
err = p.cfg.PublishTx(justiceTxn, label)
|
||||
if err != nil {
|
||||
log.Errorf("Unable to publish justice txn for client=%s"+
|
||||
"with breach-txid=%s: %v",
|
||||
|
Reference in New Issue
Block a user