signpsbt: add signonly parameter to restrict/enforce what inputs to sign.

This is an extra safety check for dual funding, where we only want to sign
the inputs we provided!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `signpsbt` takes an optional `signonly` array to limit what inputs to sign.
This commit is contained in:
Rusty Russell
2020-08-18 13:57:04 +09:30
committed by neil saitug
parent aab3808668
commit 7435d50970
3 changed files with 87 additions and 6 deletions

View File

@@ -1155,12 +1155,13 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("utxopsbt", payload)
def signpsbt(self, psbt):
def signpsbt(self, psbt, signonly=None):
"""
Add internal wallet's signatures to PSBT
"""
payload = {
"psbt": psbt,
"signonly": signonly,
}
return self.call("signpsbt", payload)