@@ -54,7 +54,13 @@ static UniValue AddDomainEntry(const JSONRPCRequest& request, BDAP::ObjectType b
54
54
CPubKey pubWalletKey;
55
55
CharString vchDHTPubKey;
56
56
if (!pwalletMain->GetEdKeyFromPool (pubWalletKey, vchDHTPubKey, true ))
57
- throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: Keypool ran out, please call keypoolrefill first" );
57
+ throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: EdKeypool ran out, please call edkeypoolrefill first" );
58
+
59
+ while (pDomainEntryDB->DomainEntryExistsPubKey (vchDHTPubKey)) {
60
+ if (!pwalletMain->GetEdKeyFromPool (pubWalletKey, vchDHTPubKey, true ))
61
+ throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: EdKeypool ran out, please call edkeypoolrefill first" );
62
+ };
63
+
58
64
CKeyID keyWalletID = pubWalletKey.GetID ();
59
65
CDynamicAddress walletAddress = CDynamicAddress (keyWalletID);
60
66
@@ -84,8 +90,12 @@ static UniValue AddDomainEntry(const JSONRPCRequest& request, BDAP::ObjectType b
84
90
// TODO: Use stealth address for the link address so linking will be private
85
91
// now using GetKeyFromPool instead of MakeNewKey
86
92
CPubKey pubLinkKey;
87
- if (!pwalletMain->GetKeyFromPool (pubLinkKey, true ))
88
- throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: Keypool ran out, please call keypoolrefill first" );
93
+ CharString NAvchDHTPubKey; // not really used
94
+ if (!pwalletMain->GetEdKeyFromPool (pubLinkKey, NAvchDHTPubKey, true ))
95
+ throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: EdKeypool ran out, please call edkeypoolrefill first" );
96
+
97
+ // if (!pwalletMain->GetKeyFromPool(pubLinkKey, true))
98
+ // throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
89
99
90
100
CKeyID keyLinkID = pubLinkKey.GetID ();
91
101
CDynamicAddress linkAddress = CDynamicAddress (keyLinkID);
@@ -879,7 +889,7 @@ UniValue mybdapaccounts(const JSONRPCRequest& request)
879
889
uint32_t nCount = 1 ;
880
890
for (const std::vector<unsigned char >& vchPubKey : vvchDHTPubKeys) {
881
891
CDomainEntry entry;
882
- LogPrintf (" DEBUGGER ED %s - PubKey [%s]\n " ,__func__,stringFromVch (vchPubKey));
892
+ // LogPrintf("DEBUGGER ED %s - PubKey [%s]\n",__func__,stringFromVch(vchPubKey));
883
893
if (pDomainEntryDB->ReadDomainEntryPubKey (vchPubKey, entry)) {
884
894
UniValue oAccount (UniValue::VOBJ);
885
895
if (BuildBDAPJson (entry, oAccount, false )) {
0 commit comments