Skip to content

zcash_client_backend: Support note locking #2161

@nuttycom

Description

@nuttycom

We need to add a "note locking" feature to zcash_client_backend and zcash_client_sqlite. The essential changes that we need are: add a lock_output method to the WalletWrite trait that takes a (pool, txid, output_index) tuple as its argument, and that adds a locked flag to that note's record in the backing data store; add a database migration to update the storage appropriately. Note selection methods and queries should be modified to take an include_locked parameter; when the value of that parameter is false, locked notes should not be returned from note selection queries and should not be included in balance. Methods that create transaction proposals should also take an added lock_notes parameter (that defaults to false); when true, the notes selected for spending should be locked before the proposal is returned.

When a proposal to spend locked notes (or a PCZT that spends locked notes) is finally built into an actual transaction, the notes should be unlocked - we will allow the preexisting transaction expiry-based locking functionality to function there. Note locking has effect only between the time of creating a proposal or pczt, and the time that the proposal is acted upon to construct a transaction.

Metadata

Metadata

Assignees

Labels

S-in-progressStatus: Work is currently in progress on this item.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions