mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
reserve/unreserve input: new RPC commands for reserving inputs/outputs
Reserve and unreserve wallet UTXOs using a PSBT which includes those inputs. Note that currently we unreserve inputs everytime the node restarts. This will be addressed in a future commit. Changelog-Added: JSON-RPC: Adds two new rpc methods, `reserveinputs` and `unreserveinputs`, which allow for reserving or unreserving wallet UTXOs
This commit is contained in:
committed by
Christian Decker
parent
b90be4f6c8
commit
103dce63ef
@@ -1107,6 +1107,28 @@ class LightningRpc(UnixDomainSocketRpc):
|
||||
}
|
||||
return self.call("txsend", payload)
|
||||
|
||||
def reserveinputs(self, outputs, feerate=None, minconf=None, utxos=None):
|
||||
"""
|
||||
Reserve UTXOs and return a psbt for a 'stub' transaction that
|
||||
spends the reserved UTXOs.
|
||||
"""
|
||||
payload = {
|
||||
"outputs": outputs,
|
||||
"feerate": feerate,
|
||||
"minconf": minconf,
|
||||
"utxos": utxos,
|
||||
}
|
||||
return self.call("reserveinputs", payload)
|
||||
|
||||
def unreserveinputs(self, psbt):
|
||||
"""
|
||||
Unreserve UTXOs that were previously reserved.
|
||||
"""
|
||||
payload = {
|
||||
"psbt": psbt,
|
||||
}
|
||||
return self.call("unreserveinputs", payload)
|
||||
|
||||
def signmessage(self, message):
|
||||
"""
|
||||
Sign a message with this node's secret key.
|
||||
|
||||
Reference in New Issue
Block a user