Skip to content

Commit

Permalink
Document why we use a separate, specific file for the onchain key man…
Browse files Browse the repository at this point in the history
…ager

Using a new signer section is eclair.conf would be simpler but "leaks" because it becomes available everywhere
in the code through the actor system's settings instead of being contained to where it is actually needed
and could potentially be exposed through a bug that "exports" the configuration (through logs, ....)
though this is highly unlikely.
  • Loading branch information
sstone committed Aug 17, 2023
1 parent a8067c4 commit 728e38d
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ import scala.util.Try
object LocalOnchainKeyManager extends Logging {
def descriptorChecksum(span: String): String = fr.acinq.bitcoin.Descriptor.checksum(span)

/**
* Load a configuration file and create an onchain key manager
*
* @param datadir eclair data directory
* @param chainHash chain we're on
* @return a LocalOnchainKeyManager instance if a configuration file exists
*/
def load(datadir: File, chainHash: ByteVector32): Option[LocalOnchainKeyManager] = {
// we use a specific file instead of adding values to eclair's configuration file because it is available everywhere in the code through
// the actor system's settings and we'd like to restrict access to the onchain wallet seed
val file = new File(datadir, "eclair-signer.conf")
if (file.exists()) {
val config = ConfigFactory.parseFile(file)
Expand Down

0 comments on commit 728e38d

Please sign in to comment.