private TxOut BuildOfferedHtlcOutput(Htlc trimmedOfferedHtlc)
        {
            PubKey localHtlcPubkey       = new PubKey(CommitmentTxParams.HtlcPublicKey.PublicKeyCompressed);
            PubKey remoteHtlcPubkey      = new PubKey(RemoteHtlcPubkey.PublicKeyCompressed);
            PubKey localRevocationPubkey = new PubKey(CommitmentTxParams.RevocationPublicKey.PublicKeyCompressed);
            Script script = OutputScripts.OfferedHtlc(localHtlcPubkey, remoteHtlcPubkey, localRevocationPubkey, trimmedOfferedHtlc.PaymentHash);

            return(new TxOut(Money.Satoshis(trimmedOfferedHtlc.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));
 }