Skip to main content

Module connection

Module connection 

Source
Expand description

The barkd single-instance guarantee: barkd.lock, exclusively locked for the process lifetime. The wallet’s LOCK can’t serve here, since it is only taken once a wallet is open.

Constants§

BARKD_LOCK_FILE
File in the datadir exclusively locked for the lifetime of a barkd process.

Functions§

acquire_barkd_lock
Take the exclusive barkd lock on the datadir, or fail fast when another barkd already runs there. The OS releases the lock when the returned value is dropped or the process exits, even on SIGKILL or a crash.
wipe_datadir_except_barkd_files
Remove everything in the datadir except the running barkd’s own files, so the held lock and auth token survive a wallet wipe.