Skip to main content

store_supports_safe_deposit

Function store_supports_safe_deposit 

Source
pub(crate) async fn store_supports_safe_deposit(
    dbtx: DatabaseTransaction<'_, Committable>,
)
Expand description

Records in dbtx that the federation’s wallet module consensus version was verified to support safe deposits, and commits it.

The marker is written by both the background version poller and WalletClientModule::supports_safe_deposit, which race right after joining a federation. The loser’s commit fails with a write conflict, but the winner stored the very same marker and nothing ever removes it, so the conflict is treated as success. That is only sound for a fresh dbtx whose sole write is the marker: any other write in it would be lost as well.

Any other commit error is logged rather than escalated: the marker only lets future checks skip re-verifying the version, callers already have their answer, and the next verification simply writes it again — an optional write is not worth crashing over.