mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-13 12:33:04 +02:00
account: fix nits
This commit is contained in:
parent
a5539ee08a
commit
41fd69fa80
1 changed files with 47 additions and 44 deletions
|
|
@ -577,10 +577,10 @@ func (o OutputsWithImplicitFee) Outputs() []*wire.TxOut {
|
|||
return o
|
||||
}
|
||||
|
||||
// Outputs is the list of outputs that should be used for the closing
|
||||
// CloseOutputs is the list of outputs that should be used for the closing
|
||||
// transaction of an account using an implicit fee expression.
|
||||
func (o OutputsWithImplicitFee) CloseOutputs(accountValue btcutil.Amount,
|
||||
witnessType witnessType) ([]*wire.TxOut, error) {
|
||||
func (o OutputsWithImplicitFee) CloseOutputs(_ btcutil.Amount,
|
||||
_ witnessType) ([]*wire.TxOut, error) {
|
||||
|
||||
return o, nil
|
||||
}
|
||||
|
|
@ -593,85 +593,88 @@ type Manager interface {
|
|||
// Stop safely stops any ongoing operations within the Manager.
|
||||
Stop()
|
||||
|
||||
// QuoteAccount returns the expected fee rate and total miner fee to send to an
|
||||
// account funding output with the given confTarget.
|
||||
// QuoteAccount returns the expected fee rate and total miner fee to
|
||||
// send to an account funding output with the given confTarget.
|
||||
QuoteAccount(ctx context.Context, value btcutil.Amount,
|
||||
confTarget uint32) (chainfee.SatPerKWeight, btcutil.Amount, error)
|
||||
confTarget uint32) (chainfee.SatPerKWeight, btcutil.Amount,
|
||||
error)
|
||||
|
||||
// InitAccount handles a request to create a new account with the provided
|
||||
// parameters.
|
||||
// InitAccount handles a request to create a new account with the
|
||||
// provided parameters.
|
||||
InitAccount(ctx context.Context, value btcutil.Amount, version Version,
|
||||
feeRate chainfee.SatPerKWeight, expiry,
|
||||
bestHeight uint32) (*Account, error)
|
||||
|
||||
// WatchMatchedAccounts resumes accounts that were just matched in a batch and
|
||||
// are expecting the batch transaction to confirm as their next account output.
|
||||
// This will cancel all previous spend and conf watchers of all accounts
|
||||
// involved in the batch.
|
||||
// WatchMatchedAccounts resumes accounts that were just matched in a
|
||||
// batch and are expecting the batch transaction to confirm as their
|
||||
// next account output. This will cancel all previous spend and conf
|
||||
// watchers of all accounts involved in the batch.
|
||||
WatchMatchedAccounts(ctx context.Context,
|
||||
matchedAccounts []*btcec.PublicKey) error
|
||||
|
||||
// HandleAccountConf takes the necessary steps after detecting the confirmation
|
||||
// of an account on-chain.
|
||||
// HandleAccountConf takes the necessary steps after detecting the
|
||||
// confirmation of an account on-chain.
|
||||
HandleAccountConf(traderKey *btcec.PublicKey,
|
||||
confDetails *chainntnfs.TxConfirmation) error
|
||||
|
||||
// HandleAccountSpend handles the different spend paths of an account. If an
|
||||
// account is spent by the expiration path, it'll always be marked as closed
|
||||
// thereafter. If it is spent by the cooperative path with the auctioneer, then
|
||||
// the account will only remain open if the spending transaction recreates the
|
||||
// account with the expected next account script. Otherwise, it is also marked
|
||||
// as closed. In case of multiple consecutive batches with the same account, we
|
||||
// only track the spend of the latest batch, after it confirmed. So the account
|
||||
// output in the spend transaction should always match our database state if
|
||||
// it was a cooperative spend.
|
||||
// HandleAccountSpend handles the different spend paths of an account.
|
||||
// If an account is spent by the expiration path, it'll always be marked
|
||||
// as closed thereafter. If it is spent by the cooperative path with the
|
||||
// auctioneer, then the account will only remain open if the spending
|
||||
// transaction recreates the account with the expected next account
|
||||
// script. Otherwise, it is also marked as closed. In case of multiple
|
||||
// consecutive batches with the same account, we only track the spend of
|
||||
// the latest batch, after it confirmed. So the account/ output in the
|
||||
// spend transaction should always match our database state if it was a
|
||||
// cooperative spend.
|
||||
HandleAccountSpend(traderKey *btcec.PublicKey,
|
||||
spendDetails *chainntnfs.SpendDetail) error
|
||||
|
||||
// HandleAccountExpiry marks an account as expired within the database.
|
||||
HandleAccountExpiry(traderKey *btcec.PublicKey,
|
||||
height uint32) error
|
||||
HandleAccountExpiry(traderKey *btcec.PublicKey, height uint32) error
|
||||
|
||||
// DepositAccount attempts to deposit funds into the account associated with the
|
||||
// given trader key such that the new account value is met using inputs sourced
|
||||
// from the backing lnd node's wallet. If needed, a change output that does back
|
||||
// to lnd may be added to the deposit transaction.
|
||||
// DepositAccount attempts to deposit funds into the account associated
|
||||
// with the given trader key such that the new account value is met
|
||||
// using inputs sourced from the backing lnd node's wallet. If needed, a
|
||||
// change output that does back to lnd may be added to the deposit
|
||||
// transaction.
|
||||
DepositAccount(ctx context.Context, traderKey *btcec.PublicKey,
|
||||
depositAmount btcutil.Amount, feeRate chainfee.SatPerKWeight,
|
||||
bestHeight, expiryHeight uint32, newVersion Version) (*Account,
|
||||
*wire.MsgTx, error)
|
||||
|
||||
// WithdrawAccount attempts to withdraw funds from the account associated with
|
||||
// the given trader key into the provided outputs.
|
||||
// WithdrawAccount attempts to withdraw funds from the account
|
||||
// associated with the given trader key into the provided outputs.
|
||||
WithdrawAccount(ctx context.Context, traderKey *btcec.PublicKey,
|
||||
outputs []*wire.TxOut, feeRate chainfee.SatPerKWeight,
|
||||
bestHeight, expiryHeight uint32, newVersion Version) (*Account,
|
||||
*wire.MsgTx, error)
|
||||
|
||||
// RenewAccount updates the expiration of an open/expired account. This will
|
||||
// always require a signature from the auctioneer, even after the account has
|
||||
// expired, to ensure the auctioneer is aware the account is being renewed.
|
||||
// RenewAccount updates the expiration of an open/expired account. This
|
||||
// will always require a signature from the auctioneer, even after the
|
||||
// account has expired, to ensure the auctioneer is aware the account is
|
||||
// being renewed.
|
||||
RenewAccount(ctx context.Context, traderKey *btcec.PublicKey,
|
||||
newExpiry uint32, feeRate chainfee.SatPerKWeight,
|
||||
bestHeight uint32, newVersion Version) (*Account, *wire.MsgTx,
|
||||
error)
|
||||
|
||||
// BumpAccountFee attempts to bump the fee of an account's most recent
|
||||
// transaction. This is done by locating an eligible output for lnd to CPFP,
|
||||
// otherwise the fee bump will not succeed. Further invocations of this call for
|
||||
// the same account will result in the child being replaced by the higher fee
|
||||
// transaction (RBF).
|
||||
// transaction. This is done by locating an eligible output for lnd to
|
||||
// CPFP, otherwise the fee bump will not succeed. Further invocations of
|
||||
// this call for the same account will result in the child being
|
||||
// replaced by the higher fee transaction (RBF).
|
||||
BumpAccountFee(ctx context.Context, traderKey *btcec.PublicKey,
|
||||
newFeeRate chainfee.SatPerKWeight) error
|
||||
|
||||
// CloseAccount attempts to close the account associated with the given trader
|
||||
// key. Closing the account requires a signature of the auctioneer if the
|
||||
// account has not yet expired. The account funds are swept according to the
|
||||
// provided fee expression.
|
||||
// CloseAccount attempts to close the account associated with the given
|
||||
// trader key. Closing the account requires a signature of the
|
||||
// auctioneer if the account has not yet expired. The account funds are
|
||||
// swept according to the provided fee expression.
|
||||
CloseAccount(ctx context.Context, traderKey *btcec.PublicKey,
|
||||
feeExpr FeeExpr, bestHeight uint32) (*wire.MsgTx, error)
|
||||
|
||||
// RecoverAccount re-introduces a recovered account into the database and starts
|
||||
// all watchers necessary depending on the account's state.
|
||||
// RecoverAccount re-introduces a recovered account into the database
|
||||
// and starts all watchers necessary depending on the account's state.
|
||||
RecoverAccount(ctx context.Context, account *Account) error
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue