Skip to content

Commit 091445a

Browse files
committed
fix(funder): Add egoistic check, otherwise one participant is always egoistic
Signed-off-by: Sophia Koehler <sophia@perun.network>
1 parent 6823276 commit 091445a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

channel/multi/funder.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type Funder struct {
4141
// NewFunder creates a new funder.
4242
func NewFunder() *Funder {
4343
return &Funder{
44-
funders: make(map[AssetIDKey]channel.Funder),
44+
funders: make(map[AssetIDKey]channel.Funder),
45+
egoistic: false,
4546
}
4647
}
4748

@@ -75,7 +76,7 @@ func (f *Funder) Fund(ctx context.Context, request channel.FundingReq) error {
7576
var nonEgoisticLedgers []AssetID
7677

7778
for i, l := range assetIDs {
78-
if f.egoisticIndex == i {
79+
if f.egoistic && f.egoisticIndex == i {
7980
egoisticLedgers = append(egoisticLedgers, l)
8081
} else {
8182
nonEgoisticLedgers = append(nonEgoisticLedgers, l)

0 commit comments

Comments
 (0)