Browse Source

sweep: do not combine exclusive and non-exclusive inputs

master
Joost Jager 4 years ago
parent
commit
cdbde5dd4c
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7
  1. 15
      sweep/bucket_list.go

15
sweep/bucket_list.go

@ -9,9 +9,20 @@ func (b bucket) tryAdd(input *pendingInput) bool {
if exclusiveGroup != nil {
for _, input := range b {
existingGroup := input.params.ExclusiveGroup
if existingGroup != nil &&
*existingGroup == *exclusiveGroup {
// Don't add an exclusive group input if other inputs
// are non-exclusive. The exclusive group input may be
// invalid (for example in the case of commitment
// anchors) and could thereby block sweeping of the
// other inputs.
if existingGroup == nil {
return false
}
// Don't combine inputs from the same exclusive group.
// Because only one input is valid, this may result in
// txes that are always invalid.
if *existingGroup == *exclusiveGroup {
return false
}
}

Loading…
Cancel
Save