walletrpc: add transaction label to PublishTransaction

This commit is contained in:
carla committed 2020-05-19 13:31:51 +02:00
1 parent 099161ed0b
commit 93a1b61218
3 files changed
+120 -83

No files matched your search

+12 -3
View File
@@ -274,7 +274,12 @@ func (w *WalletKit) PublishTransaction(ctx context.Context,
return nil, err
}
err := w.cfg.Wallet.PublishTransaction(tx, labels.External)
label, err := labels.ValidateAPI(req.Label)
if err != nil {
return nil, err
}
err = w.cfg.Wallet.PublishTransaction(tx, label)
if err != nil {
return nil, err
}
@@ -307,11 +312,15 @@ func (w *WalletKit) SendOutputs(ctx context.Context,
})
}
label, err := labels.ValidateAPI(req.Label)
if err != nil {
return nil, err
}
// Now that we have the outputs mapped, we can request that the wallet
// attempt to create this transaction.
tx, err := w.cfg.Wallet.SendOutputs(
outputsToCreate, chainfee.SatPerKWeight(req.SatPerKw),
labels.External,
outputsToCreate, chainfee.SatPerKWeight(req.SatPerKw), label,
)
if err != nil {
return nil, err