mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-06 01:18:17 +02:00
lnwallet: adds RequiredReserve method
This commit is contained in:
@@ -105,6 +105,11 @@ func (w *WalletController) ListAccounts(string,
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RequiredReserve currently returns a dummy value.
|
||||||
|
func (w *WalletController) RequiredReserve(uint32) btcutil.Amount {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// ImportAccount currently returns a dummy value.
|
// ImportAccount currently returns a dummy value.
|
||||||
func (w *WalletController) ImportAccount(string, *hdkeychain.ExtendedKey,
|
func (w *WalletController) ImportAccount(string, *hdkeychain.ExtendedKey,
|
||||||
uint32, *waddrmgr.AddressType, bool) (*waddrmgr.AccountProperties,
|
uint32, *waddrmgr.AddressType, bool) (*waddrmgr.AccountProperties,
|
||||||
|
@@ -711,6 +711,22 @@ func (b *BtcWallet) ListAccounts(name string,
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RequiredReserve returns the minimum amount of satoshis that should be
|
||||||
|
// kept in the wallet in order to fee bump anchor channels if necessary.
|
||||||
|
// The value scales with the number of public anchor channels but is
|
||||||
|
// capped at a maximum.
|
||||||
|
func (b *BtcWallet) RequiredReserve(
|
||||||
|
numAnchorChans uint32) btcutil.Amount {
|
||||||
|
|
||||||
|
anchorChanReservedValue := lnwallet.AnchorChanReservedValue
|
||||||
|
reserved := btcutil.Amount(numAnchorChans) * anchorChanReservedValue
|
||||||
|
if reserved > lnwallet.MaxAnchorChanReservedValue {
|
||||||
|
reserved = lnwallet.MaxAnchorChanReservedValue
|
||||||
|
}
|
||||||
|
|
||||||
|
return reserved
|
||||||
|
}
|
||||||
|
|
||||||
// ImportAccount imports an account backed by an account extended public key.
|
// ImportAccount imports an account backed by an account extended public key.
|
||||||
// The master key fingerprint denotes the fingerprint of the root key
|
// The master key fingerprint denotes the fingerprint of the root key
|
||||||
// corresponding to the account public key (also known as the key with
|
// corresponding to the account public key (also known as the key with
|
||||||
|
@@ -244,6 +244,12 @@ type WalletController interface {
|
|||||||
ListAccounts(string, *waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties,
|
ListAccounts(string, *waddrmgr.KeyScope) ([]*waddrmgr.AccountProperties,
|
||||||
error)
|
error)
|
||||||
|
|
||||||
|
// RequiredReserve returns the minimum amount of satoshis that should be
|
||||||
|
// kept in the wallet in order to fee bump anchor channels if necessary.
|
||||||
|
// The value scales with the number of public anchor channels but is
|
||||||
|
// capped at a maximum.
|
||||||
|
RequiredReserve(uint32) btcutil.Amount
|
||||||
|
|
||||||
// ImportAccount imports an account backed by an account extended public
|
// ImportAccount imports an account backed by an account extended public
|
||||||
// key. The master key fingerprint denotes the fingerprint of the root
|
// key. The master key fingerprint denotes the fingerprint of the root
|
||||||
// key corresponding to the account public key (also known as the key
|
// key corresponding to the account public key (also known as the key
|
||||||
|
Reference in New Issue
Block a user