Skip to content

Commit

Permalink
Simplify CryptoUtil helper
Browse files Browse the repository at this point in the history
  • Loading branch information
knocte committed Jun 1, 2021
1 parent 6d8448b commit 458c1b5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/GWallet.Backend/UtxoCoin/Lightning/ChannelManagement.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ type ChannelInfo =

module internal CryptoUtil =
let internal AccountPrivateKeyToNodeMasterPrivKey (accountKey: Key): NodeMasterPrivKey =
let privateKeyBytesLength = 32
let bytes: array<byte> = Array.zeroCreate privateKeyBytesLength
use bytesStream = new MemoryStream(bytes)
let stream = NBitcoin.BitcoinStream(bytesStream, true)
accountKey.ReadWrite stream
let bytes = accountKey.ToBytes ()
let hashed = NBitcoin.Crypto.Hashes.DoubleSHA256 bytes
NodeMasterPrivKey <| NBitcoin.ExtKey (hashed.ToString())

Expand Down

0 comments on commit 458c1b5

Please sign in to comment.