Skip to content

Commit 77a3959

Browse files
furszyFuzzbawls
authored andcommitted
[Masternode] Cache decoded Masternode private key
Github-Pull: #2056 Rebased-From: 0a519bb
1 parent d4b8a32 commit 77a3959

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/activemasternode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ OperationResult initMasternode(const std::string& _strMasterNodePrivKey, const s
5656

5757
CKey key;
5858
CPubKey pubkey;
59-
6059
if (!CMessageSigner::GetKeysFromSecret(strMasterNodePrivKey, key, pubkey)) {
6160
return errorOut(_("Invalid masternodeprivkey. Please see the documentation."));
6261
}
62+
6363
activeMasternode.pubKeyMasternode = pubkey;
64+
activeMasternode.privKeyMasternode = key;
6465
fMasterNode = true;
6566
return OperationResult(true);
6667
}

src/activemasternode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class CActiveMasternode
4040
// Initialized by init.cpp
4141
// Keys for the main Masternode
4242
CPubKey pubKeyMasternode;
43+
CKey privKeyMasternode;
4344

4445
// Initialized while registering Masternode
4546
Optional<CTxIn> vin;

0 commit comments

Comments
 (0)