mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 08:41:42 +02:00
sweep: start tracking inputs spent by unknown tx
This commit adds a new field `InputsSpent` to the `BumpResult` so they can be used to track inputs spent by txns not recoginized by the fee bumper.
This commit is contained in:
@@ -1772,6 +1772,13 @@ func TestProcessRecordsSpent(t *testing.T) {
|
||||
tp.subscriberChans.Store(requestID, subscriber)
|
||||
tp.records.Store(requestID, recordConfirmed)
|
||||
|
||||
// Mock the fee function to increase feerate.
|
||||
m.feeFunc.On("Increment").Return(true, nil).Once()
|
||||
|
||||
// Create a test feerate and return it from the mock fee function.
|
||||
feerate := chainfee.SatPerKWeight(1000)
|
||||
m.feeFunc.On("FeeRate").Return(feerate)
|
||||
|
||||
// Call processRecords and expect the results are notified back.
|
||||
tp.processRecords()
|
||||
|
||||
@@ -1785,6 +1792,9 @@ func TestProcessRecordsSpent(t *testing.T) {
|
||||
require.Equal(t, TxUnknownSpend, result.Event)
|
||||
require.Equal(t, tx, result.Tx)
|
||||
|
||||
// We expect the fee rate to be updated.
|
||||
require.Equal(t, feerate, result.FeeRate)
|
||||
|
||||
// No error should be set.
|
||||
require.ErrorIs(t, result.Err, ErrUnknownSpent)
|
||||
require.Equal(t, requestID, result.requestID)
|
||||
|
Reference in New Issue
Block a user