private TxOut BuildReceivedHtlcOutput(Htlc trimmedReceivedHtlc) { PubKey localHtlcPubkey = new PubKey(CommitmentTxParams.HtlcPublicKey.PublicKeyCompressed); PubKey remoteHtlcPubkey = new PubKey(RemoteHtlcPubkey.PublicKeyCompressed); PubKey localRevocationPubkey = new PubKey(CommitmentTxParams.RevocationPublicKey.PublicKeyCompressed); Script script = OutputScripts.ReceivedHtlc(localHtlcPubkey, remoteHtlcPubkey, localRevocationPubkey, trimmedReceivedHtlc.PaymentHash, trimmedReceivedHtlc.Expiry); return(new TxOut(Money.Satoshis(trimmedReceivedHtlc.AmountMsat.MSatToSatoshi()), script.WitHash.ScriptPubKey)); }
private Script CreateHtlcWitnessScript(Htlc htlc) { return(htlc.Direction == Direction.Incoming ? OutputScripts.ReceivedHtlc(CommitmentTxParams.HtlcPublicKey.ToPubKey(), RemoteHtlcPubkey.ToPubKey(), CommitmentTxParams.RevocationPublicKey.ToPubKey(), htlc.PaymentHash, htlc.Expiry) : OutputScripts.OfferedHtlc(CommitmentTxParams.HtlcPublicKey.ToPubKey(), RemoteHtlcPubkey.ToPubKey(), CommitmentTxParams.RevocationPublicKey.ToPubKey(), htlc.PaymentHash)); }