mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
channeldb: replace fetch channels booleans with optional filters
This changes replaces the pending an waiting booleans in fetchChannels with optional filters which can be more flexibly used. This change allows filtering of channels without having to reason about the matrix of possible boolean combinations. A test is added to ensure that the combinations of these filters act as expected.
This commit is contained in:
@@ -187,6 +187,13 @@ func fundingPointOption(chanPoint wire.OutPoint) testChannelOption {
|
||||
}
|
||||
}
|
||||
|
||||
// channelIDOption is an option which sets the short channel ID of the channel.
|
||||
var channelIDOption = func(chanID lnwire.ShortChannelID) testChannelOption {
|
||||
return func(params *testChannelParams) {
|
||||
params.channel.ShortChannelID = chanID
|
||||
}
|
||||
}
|
||||
|
||||
// createTestChannel writes a test channel to the database. It takes a set of
|
||||
// functional options which can be used to overwrite the default of creating
|
||||
// a pending channel that was broadcast at height 100.
|
||||
|
Reference in New Issue
Block a user