@@ -87,41 +87,31 @@ UniValue createrawbdapaccount(const JSONRPCRequest& request)
87
87
throw std::runtime_error (" BDAP_CREATE_RAW_TX_RPC_ERROR: ERRCODE: 4503 - " + txDomainEntry.GetFullObjectPath () + _ (" entry already exists. Can not add duplicate." ));
88
88
89
89
// TODO: Add ability to pass in the wallet address
90
- // now using GetKeyFromPool instead of MakeNewKey
91
- std::vector<unsigned char > newEdKey;
90
+ std::vector<unsigned char > vchDHTPubKey;
92
91
CPubKey pubWalletKey;
93
- if (!pwalletMain->GetKeysFromPool (pubWalletKey, newEdKey , true ))
92
+ if (!pwalletMain->GetKeysFromPool (pubWalletKey, vchDHTPubKey , true ))
94
93
throw std::runtime_error (" Error: Keypool ran out, please call keypoolrefill first" );
95
94
CKeyID keyWalletID = pubWalletKey.GetID ();
96
95
CDynamicAddress walletAddress = CDynamicAddress (keyWalletID);
97
96
98
-
99
97
pwalletMain->SetAddressBook (keyWalletID, strObjectID, " bdap-wallet" );
100
98
101
99
CharString vchWalletAddress = vchFromString (walletAddress.ToString ());
102
100
txDomainEntry.WalletAddress = vchWalletAddress;
103
101
104
- // TODO: Add ability to pass in the DHT public key
105
- CKeyEd25519 privDHTKey;
106
- CharString vchDHTPubKey = privDHTKey.GetPubKey ();
107
-
108
- if (pwalletMain && !pwalletMain->AddDHTKey (privDHTKey, vchDHTPubKey))
109
- throw std::runtime_error (" BDAP_CREATE_RAW_TX_RPC_ERROR: ERRCODE: 4505 - " + _ (" Error adding ed25519 key to wallet for BDAP" ));
110
-
102
+ CKeyID vchDHTPubKeyID = GetIdFromCharVector (vchDHTPubKey);
111
103
txDomainEntry.DHTPublicKey = vchDHTPubKey;
112
- pwalletMain->SetAddressBook (privDHTKey. GetID () , strObjectID, " bdap-dht-key" );
104
+ pwalletMain->SetAddressBook (vchDHTPubKeyID , strObjectID, " bdap-dht-key" );
113
105
114
106
// TODO: Add ability to pass in the link address
115
107
// TODO: Use stealth address for the link address so linking will be private
116
- // now using GetKeyFromPool instead of MakeNewKey
117
108
CPubKey pubLinkKey;
118
109
std::vector<unsigned char > newEdKey2;
119
110
if (!pwalletMain->GetKeysFromPool (pubLinkKey, newEdKey2, true ))
120
111
throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: Keypool ran out, please call keypoolrefill first" );
121
112
CKeyID keyLinkID = pubLinkKey.GetID ();
122
113
CDynamicAddress linkAddress = CDynamicAddress (keyLinkID);
123
114
124
-
125
115
pwalletMain->SetAddressBook (keyLinkID, strObjectID, " bdap-link" );
126
116
127
117
CharString vchLinkAddress = vchFromString (linkAddress.ToString ());
0 commit comments