Skip to content

Commit 53f7f27

Browse files
t-bastsstone
authored andcommitted
Use shared input's txOut in shouldSignFirst (#2934)
This is clearer that way and yields the same result: we only look at `txOut` amounts when computing each node's contributions.
1 parent d560a8c commit 53f7f27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

eclair-core/src/main/scala/fr/acinq/eclair/channel/fund/InteractiveTxBuilder.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ object InteractiveTxSigningSession {
10081008
case class UnsignedLocalCommit(index: Long, spec: CommitmentSpec, commitTx: CommitTx, htlcTxs: List[HtlcTx])
10091009

10101010
private def shouldSignFirst(isInitiator: Boolean, channelParams: ChannelParams, tx: SharedTransaction): Boolean = {
1011-
val sharedAmountIn = tx.sharedInput_opt.map(i => i.localAmount + i.remoteAmount + i.htlcAmount).getOrElse(0 msat).truncateToSatoshi
1011+
val sharedAmountIn = tx.sharedInput_opt.map(_.txOut.amount).getOrElse(0 sat)
10121012
val (localAmountIn, remoteAmountIn) = if (isInitiator) {
10131013
(sharedAmountIn + tx.localInputs.map(i => i.txOut.amount).sum, tx.remoteInputs.map(i => i.txOut.amount).sum)
10141014
} else {

0 commit comments

Comments
 (0)