Skip to content

multi: Add label to PublishTransaction #1411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions chain_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,8 @@ func (l *LndRpcChainBridge) GetBlockTimestamp(ctx context.Context,
// PublishTransaction attempts to publish a new transaction to the
// network.
func (l *LndRpcChainBridge) PublishTransaction(ctx context.Context,
tx *wire.MsgTx) error {
tx *wire.MsgTx, label string) error {

label := "tapd-asset-minting"
return l.lnd.WalletKit.PublishTransaction(ctx, tx, label)
}

Expand Down
2 changes: 1 addition & 1 deletion tapchannel/aux_funding_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ type PsbtChannelFunder interface {
type TxPublisher interface {
// PublishTransaction attempts to publish a new transaction to the
// network.
PublishTransaction(context.Context, *wire.MsgTx) error
PublishTransaction(context.Context, *wire.MsgTx, string) error
}

// AssetSyncer is used to ensure that we know of the set of assets that'll be
Expand Down
2 changes: 1 addition & 1 deletion tapfreighter/chain_porter.go
Original file line number Diff line number Diff line change
Expand Up @@ -1367,7 +1367,7 @@ func (p *ChainPorter) stateStep(currentPkg sendPackage) (*sendPackage, error) {
// With the public key imported, we can now broadcast to the
// network.
err = p.cfg.ChainBridge.PublishTransaction(
ctx, currentPkg.OutboundPkg.AnchorTx,
ctx, currentPkg.OutboundPkg.AnchorTx, "tapd-asset-send",
)
switch {
case errors.Is(err, lnwallet.ErrDoubleSpend):
Expand Down
4 changes: 3 additions & 1 deletion tapgarden/caretaker.go
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,9 @@ func (b *BatchCaretaker) stateStep(currentState BatchState) (BatchState, error)
// transaction, then request a confirmation notification.
ctx, cancel := b.WithCtxQuit()
defer cancel()
err = b.cfg.ChainBridge.PublishTransaction(ctx, signedTx)
err = b.cfg.ChainBridge.PublishTransaction(
ctx, signedTx, "tapd-asset-mint",
)
if err != nil {
return 0, fmt.Errorf("unable to publish "+
"transaction: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion tapgarden/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ type ChainBridge interface {

// PublishTransaction attempts to publish a new transaction to the
// network.
PublishTransaction(context.Context, *wire.MsgTx) error
PublishTransaction(context.Context, *wire.MsgTx, string) error

// EstimateFee returns a fee estimate for the confirmation target.
EstimateFee(ctx context.Context,
Expand Down
2 changes: 1 addition & 1 deletion tapgarden/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func (m *MockChainBridge) GetBlockTimestamp(_ context.Context, _ uint32) int64 {
}

func (m *MockChainBridge) PublishTransaction(_ context.Context,
tx *wire.MsgTx) error {
tx *wire.MsgTx, _ string) error {

m.PublishReq <- tx
return nil
Expand Down
Loading