walletrpc: allow custom lock ID and duration in FundPsbt - #9724
Conversation
|
Important Review skippedAuto reviews are limited to specific labels. 🏷️ Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
guggero
left a comment
There was a problem hiding this comment.
Linter complains, otherwise LGTM 🎉
7aa4da9 to
4b32244
Compare
ziggie1984
left a comment
There was a problem hiding this comment.
Looks good, had some nits, apart from that missing release notes.
| // The max fee to total output amount ratio that this psbt should adhere to. | ||
| double max_fee_ratio = 12; | ||
|
|
||
| // The custom lock ID to use for the inputs in the funded PSBT. If empty, |
There was a problem hiding this comment.
Add a comment that this needs to be 32 bytes ?
| Fees: &walletrpc.FundPsbtRequest_SatPerVbyte{ | ||
| SatPerVbyte: 2, | ||
| }, | ||
| MinConfs: 1, |
There was a problem hiding this comment.
I think we can use the default and remove these entries.
There was a problem hiding this comment.
These are also the defaults used in the other PSBT tests, so that's why they were chosen. I think we need to set these?
b9713d2 to
e86bea3
Compare
Summary
The
FundPsbtRPC must lock selected UTXOs to prevent double-use during PSBT construction. Previously, it always applied an internal default lock ID with a fixed 10-minute expiration. This rigid setup limited flexibility and made lease tracking via ListLeases difficult in multi-operation workflows.What's New
This change adds two optional fields to walletrpc.FundPsbtRequest, enabling explicit control over UTXO locking:
custom_lock_id(bytes)If set, the wallet uses this value as the lease ID for locked UTXOs.
If omitted, the wallet continues using its internal default lock ID.
lock_expiration_seconds(uint64)If non-zero, the lease expires after the given number of seconds.
Enables fine-tuning the lock duration to match the expected PSBT funding window.
If omitted or set to 0, the default 10-minute expiration is used.
Compatibility
Fully backward-compatible.
Existing clients not setting these fields will observe the exact same behavior as before.