Skip to content

Commit 9053292

Browse files
committed
🐛 [client] Defer release version 1 cache
Signed-off-by: Matthias Geihs <matthias@perun.network>
1 parent afc727e commit 9053292

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/proposal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ func (c *Client) ProposeChannel(ctx context.Context, prop ChannelProposal) (*Cha
154154
}
155155

156156
// 2. send proposal, wait for response, create channel object
157-
c.enableVer1Cache() // cache version 1 updates until channel is opened
157+
c.enableVer1Cache() // cache version 1 updates until channel is opened
158+
defer c.releaseVer1Cache() // replay cached version 1 updates
158159
ch, err := c.proposeTwoPartyChannel(ctx, prop)
159160
if err != nil {
160161
return nil, errors.WithMessage(err, "channel proposal")
161162
}
162163

163164
// 3. fund
164165
fundingErr := c.fundChannel(ctx, ch, prop)
165-
c.releaseVer1Cache() // replay cached version 1 updates
166166
return ch, fundingErr
167167
}
168168

0 commit comments

Comments
 (0)