MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GenerateAndSavePrivateKey

Method GenerateAndSavePrivateKey

src/i2p.cpp:364–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

362}
363
364void Session::GenerateAndSavePrivateKey(const Sock& sock)
365{
366 DestGenerate(sock);
367
368 // umask is set to 0077 in common/system.cpp, which is ok.
369 if (!WriteBinaryFile(m_private_key_file,
370 std::string(m_private_key.begin(), m_private_key.end()))) {
371 throw std::runtime_error(
372 strprintf("Cannot save I2P private key to %s", fs::quoted(fs::PathToString(m_private_key_file))));
373 }
374}
375
376Binary Session::MyDestination() const
377{

Callers

nothing calls this directly

Calls 5

WriteBinaryFileFunction · 0.85
quotedFunction · 0.85
PathToStringFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected