mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-09-01 17:55:15 +00:00
Return errors if rand.Read fails.
This commit is contained in:
parent
56d732ff3e
commit
c138a663e1
1 changed files with 6 additions and 2 deletions
|
@ -383,8 +383,12 @@ func NewWallet(name, desc string, passphrase []byte, net btcwire.BitcoinNet, cre
|
||||||
|
|
||||||
// Randomly-generate rootkey and chaincode.
|
// Randomly-generate rootkey and chaincode.
|
||||||
rootkey, chaincode := make([]byte, 32), make([]byte, 32)
|
rootkey, chaincode := make([]byte, 32), make([]byte, 32)
|
||||||
rand.Read(rootkey)
|
if _, err := rand.Read(rootkey); err != nil {
|
||||||
rand.Read(chaincode)
|
return nil, err
|
||||||
|
}
|
||||||
|
if _, err := rand.Read(chaincode); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Create new root address from key and chaincode.
|
// Create new root address from key and chaincode.
|
||||||
root, err := newRootBtcAddress(rootkey, nil, chaincode, createdAt)
|
root, err := newRootBtcAddress(rootkey, nil, chaincode, createdAt)
|
||||||
|
|
Loading…
Add table
Reference in a new issue