The code below from interactivetx.c enforces the interactive-tx handling rule that if the receiving node sets tlvs->shared_input_txid, then it must match the txid of the shared input. But it does not fail when tlvs->shared_input_txid is not set, but ictx->shared_outpoint is the same as the added shared input and prevtx has been set.
A check must be made when prevtx is set to make sure when adding the shared output, prevtx has not been set. We do this in Eclair here.
/* For our shared input only, we will fill in prevtx */
if (ictx->shared_outpoint && tlvs->shared_input_txid) {
if (!bitcoin_txid_eq(tlvs->shared_input_txid,
&ictx->shared_outpoint->txid))
return tal_fmt(ctx, "funding_txid value"
" %s unrecognized."
" Should be %s",
fmt_bitcoin_txid(ctx, tlvs->shared_input_txid),
fmt_bitcoin_txid(ctx, &ictx->shared_outpoint->txid));
if (!ictx->funding_tx)
return tal_fmt(ctx, "Internal error"
" did not set"
" interactivetx"
" funding_tx");
tx = ictx->funding_tx;
}
I found this missing check while investigating why during interop testing Eclair is returning InvalidSharedInput when clightning initiates the splice. If I can confirm clightning is sending an add_tx_input with prevtx set for the shared input, I'll link a new issue.
cc: @ddustin
The code below from interactivetx.c enforces the interactive-tx handling rule that if the receiving node sets
tlvs->shared_input_txid, then it must match the txid of the shared input. But it does not fail whentlvs->shared_input_txidis not set, butictx->shared_outpointis the same as the added shared input andprevtxhas been set.A check must be made when
prevtxis set to make sure when adding the shared output,prevtxhas not been set. We do this in Eclair here.I found this missing check while investigating why during interop testing Eclair is returning
InvalidSharedInputwhen clightning initiates the splice. If I can confirm clightning is sending anadd_tx_inputwith prevtx set for the shared input, I'll link a new issue.cc: @ddustin