mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 05:42:34 +02:00
sweep: add new AuxSweeper interface
In this commit, we add a new AuxSweeper interface. This'll take a set of inputs, and a change addr for the sweep transaction, then optionally return a new sweep output to be added to the sweep transaction. We also add a new NotifyBroadcast method. This'll be used to notify that we're _about_ to broadcast a sweeping transaction. The set of inputs is passed in, which allows the caller to prepare for the ultimate broadcast of the sweeping transaction. We also add ExtraTxOut to BumpRequest pass fees to NotifyBroadcast. This allows the callee to know the total fee of the sweeping transaction.
This commit is contained in:
@@ -314,3 +314,22 @@ func (m *MockFeeFunction) IncreaseFeeRate(confTarget uint32) (bool, error) {
|
||||
|
||||
return args.Bool(0), args.Error(1)
|
||||
}
|
||||
|
||||
type MockAuxSweeper struct{}
|
||||
|
||||
// DeriveSweepAddr takes a set of inputs, and the change address we'd
|
||||
// use to sweep them, and maybe results an extra sweep output that we
|
||||
// should add to the sweeping transaction.
|
||||
func (*MockAuxSweeper) DeriveSweepAddr(_ []input.Input,
|
||||
_ lnwallet.AddrWithKey) fn.Result[SweepOutput] {
|
||||
|
||||
return fn.Ok(SweepOutput{})
|
||||
}
|
||||
|
||||
// NotifyBroadcast is used to notify external callers of the broadcast
|
||||
// of a sweep transaction, generated by the passed BumpRequest.
|
||||
func (*MockAuxSweeper) NotifyBroadcast(_ *BumpRequest, _ *wire.MsgTx,
|
||||
_ btcutil.Amount) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user