1
0

encapsulate funding_address_for_channel

This commit is contained in:
ThomasV
2018-07-19 10:39:29 +02:00
parent 8e63471d69
commit bc28edf178
2 changed files with 9 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import binascii
import json
from .util import bfh, PrintError
from .bitcoin import Hash
from .bitcoin import redeem_script_to_address
from .crypto import sha256
from . import ecc
from .lnutil import Outpoint, ChannelConfig, LocalState, RemoteState, Keypair, OnlyPubkeyKeypair, ChannelConstraints, RevocationStore
@@ -12,6 +13,7 @@ from .lnutil import secret_to_pubkey, derive_privkey, derive_pubkey, derive_blin
from .lnutil import sign_and_get_sig_string
from .lnutil import make_htlc_tx_with_open_channel, make_commitment, make_received_htlc, make_offered_htlc
from .lnutil import HTLC_TIMEOUT_WEIGHT, HTLC_SUCCESS_WEIGHT
from .lnutil import funding_output_script
from contextlib import contextmanager
SettleHtlc = namedtuple("SettleHtlc", ["htlc_id"])
@@ -141,6 +143,10 @@ class HTLCStateMachine(PrintError):
self.state = 'DISCONNECTED'
def get_funding_addres(self):
script = funding_output_script(self.local_config, self.remote_config)
return redeem_script_to_address('p2wsh', script)
def add_htlc(self, htlc):
"""
AddHTLC adds an HTLC to the state machine's local update log. This method