pyln-testing: don't default openchannel and fundwallet to p2sh-segwit, use bech32.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-01-13 11:04:22 +10:30
parent e5d384a427
commit 85fc46f76c
3 changed files with 11 additions and 11 deletions

View File

@@ -842,7 +842,7 @@ class LightningNode(object):
def is_connected(self, remote_node):
return remote_node.info['id'] in [p['id'] for p in self.rpc.listpeers()['peers']]
def openchannel(self, remote_node, capacity=FUNDAMOUNT, addrtype="p2sh-segwit", confirm=True, wait_for_announce=True, connect=True):
def openchannel(self, remote_node, capacity=FUNDAMOUNT, addrtype="bech32", confirm=True, wait_for_announce=True, connect=True):
addr, wallettxid = self.fundwallet(10 * capacity, addrtype)
if connect and not self.is_connected(remote_node):
@@ -859,7 +859,7 @@ class LightningNode(object):
return {'address': addr, 'wallettxid': wallettxid, 'fundingtx': res['tx']}
def fundwallet(self, sats, addrtype="p2sh-segwit", mine_block=True):
def fundwallet(self, sats, addrtype="bech32", mine_block=True):
addr = self.rpc.newaddr(addrtype)[addrtype]
txid = self.bitcoin.rpc.sendtoaddress(addr, sats / 10**8)
if mine_block: