mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2026-02-23 15:34:22 +01:00
lnwallet: add label transaction to WalletController interface
This commit is contained in:
@@ -461,6 +461,17 @@ func (b *BtcWallet) PublishTransaction(tx *wire.MsgTx, label string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// LabelTransaction adds a label to a transaction. If the tx already
|
||||
// has a label, this call will fail unless the overwrite parameter
|
||||
// is set. Labels must not be empty, and they are limited to 500 chars.
|
||||
//
|
||||
// Note: it is part of the WalletController interface.
|
||||
func (b *BtcWallet) LabelTransaction(hash chainhash.Hash, label string,
|
||||
overwrite bool) error {
|
||||
|
||||
return b.wallet.LabelTransaction(hash, label, overwrite)
|
||||
}
|
||||
|
||||
// extractBalanceDelta extracts the net balance delta from the PoV of the
|
||||
// wallet given a TransactionSummary.
|
||||
func extractBalanceDelta(
|
||||
|
||||
@@ -231,6 +231,11 @@ type WalletController interface {
|
||||
// published transaction.
|
||||
PublishTransaction(tx *wire.MsgTx, label string) error
|
||||
|
||||
// LabelTransaction adds a label to a transaction. If the tx already
|
||||
// has a label, this call will fail unless the overwrite parameter
|
||||
// is set. Labels must not be empty, and they are limited to 500 chars.
|
||||
LabelTransaction(hash chainhash.Hash, label string, overwrite bool) error
|
||||
|
||||
// SubscribeTransactions returns a TransactionSubscription client which
|
||||
// is capable of receiving async notifications as new transactions
|
||||
// related to the wallet are seen within the network, or found in
|
||||
|
||||
7
mock.go
7
mock.go
@@ -326,6 +326,13 @@ func (m *mockWalletController) PublishTransaction(tx *wire.MsgTx, _ string) erro
|
||||
m.publishedTransactions <- tx
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *mockWalletController) LabelTransaction(_ chainhash.Hash, _ string,
|
||||
_ bool) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (*mockWalletController) SubscribeTransactions() (lnwallet.TransactionSubscription, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user