mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
pyln-client: add missing min_witness_weight to fundpsbt/utxopsbt
We need to use it for the 'df_accepter' plugin, so we get the feerate correct. Changelog-Added: pyln-client: `fundpsbt`/`utxopsbt` now support `min_witness_weight` param
This commit is contained in:
committed by
Christian Decker
parent
19afe15968
commit
cce0020568
@@ -1244,7 +1244,7 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||||||
}
|
}
|
||||||
return self.call("unreserveinputs", payload)
|
return self.call("unreserveinputs", payload)
|
||||||
|
|
||||||
def fundpsbt(self, satoshi, feerate, startweight, minconf=None, reserve=True, locktime=None):
|
def fundpsbt(self, satoshi, feerate, startweight, minconf=None, reserve=True, locktime=None, min_witness_weight=None):
|
||||||
"""
|
"""
|
||||||
Create a PSBT with inputs sufficient to give an output of satoshi.
|
Create a PSBT with inputs sufficient to give an output of satoshi.
|
||||||
"""
|
"""
|
||||||
@@ -1255,10 +1255,11 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||||||
"minconf": minconf,
|
"minconf": minconf,
|
||||||
"reserve": reserve,
|
"reserve": reserve,
|
||||||
"locktime": locktime,
|
"locktime": locktime,
|
||||||
|
"min_witness_weight": min_witness_weight,
|
||||||
}
|
}
|
||||||
return self.call("fundpsbt", payload)
|
return self.call("fundpsbt", payload)
|
||||||
|
|
||||||
def utxopsbt(self, satoshi, feerate, startweight, utxos, reserve=True, reservedok=False, locktime=None):
|
def utxopsbt(self, satoshi, feerate, startweight, utxos, reserve=True, reservedok=False, locktime=None, min_witness_weight=None):
|
||||||
"""
|
"""
|
||||||
Create a PSBT with given inputs, to give an output of satoshi.
|
Create a PSBT with given inputs, to give an output of satoshi.
|
||||||
"""
|
"""
|
||||||
@@ -1270,6 +1271,7 @@ class LightningRpc(UnixDomainSocketRpc):
|
|||||||
"reserve": reserve,
|
"reserve": reserve,
|
||||||
"reservedok": reservedok,
|
"reservedok": reservedok,
|
||||||
"locktime": locktime,
|
"locktime": locktime,
|
||||||
|
"min_witness_weight": min_witness_weight,
|
||||||
}
|
}
|
||||||
return self.call("utxopsbt", payload)
|
return self.call("utxopsbt", payload)
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,8 @@ def on_openchannel(openchannel2, plugin, **kwargs):
|
|||||||
funding = plugin.rpc.fundpsbt(amount,
|
funding = plugin.rpc.fundpsbt(amount,
|
||||||
'{}perkw'.format(feerate),
|
'{}perkw'.format(feerate),
|
||||||
0, reserve=True,
|
0, reserve=True,
|
||||||
locktime=locktime)
|
locktime=locktime,
|
||||||
|
min_witness_weight=110)
|
||||||
psbt_obj = psbt_from_base64(funding['psbt'])
|
psbt_obj = psbt_from_base64(funding['psbt'])
|
||||||
|
|
||||||
excess = Millisatoshi(funding['excess_msat'])
|
excess = Millisatoshi(funding['excess_msat'])
|
||||||
|
|||||||
Reference in New Issue
Block a user