Browse Source
lnworker: generate and save private key
regtest_lnd
ThomasV
7 years ago
committed by
SomberNight
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
1 changed files with
6 additions and
1 deletions
-
lib/lnworker.py
|
@ -91,7 +91,12 @@ class LNWorker(PrintError): |
|
|
def __init__(self, wallet, network): |
|
|
def __init__(self, wallet, network): |
|
|
self.wallet = wallet |
|
|
self.wallet = wallet |
|
|
self.network = network |
|
|
self.network = network |
|
|
self.privkey = sha256(b"0123456789") |
|
|
pk = wallet.storage.get('lightning_privkey') |
|
|
|
|
|
if pk is None: |
|
|
|
|
|
pk = bh2u(os.urandom(32)) |
|
|
|
|
|
wallet.storage.put('lightning_privkey', pk) |
|
|
|
|
|
wallet.storage.write() |
|
|
|
|
|
self.privkey = bfh(pk) |
|
|
self.config = network.config |
|
|
self.config = network.config |
|
|
self.peers = {} |
|
|
self.peers = {} |
|
|
# view of the network |
|
|
# view of the network |
|
|