@@ -48,44 +48,24 @@ static UniValue AddDomainEntry(const JSONRPCRequest& request, BDAP::ObjectType b
48
48
if (GetDomainEntry (txDomainEntry.vchFullObjectPath (), txDomainEntry))
49
49
throw std::runtime_error (" BDAP_ADD_PUBLIC_ENTRY_RPC_ERROR: ERRCODE: 3500 - " + txDomainEntry.GetFullObjectPath () + _ (" entry already exists. Can not add duplicate." ));
50
50
51
- LogPrintf (" DEBUGGER ED %s - made it here! BEFORE\n " , __func__);
52
-
53
- // now using GetKeyFromPool instead of MakeNewKey
51
+ // now using GetKeyFromPool instead of MakeNewKey
54
52
CPubKey pubWalletKey;
55
53
CharString vchDHTPubKey;
56
54
if (!pwalletMain->GetEdKeyFromPool (pubWalletKey, vchDHTPubKey, true ))
57
55
throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: EdKeypool ran out, please call edkeypoolrefill first" );
58
56
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
-
64
57
CKeyID keyWalletID = pubWalletKey.GetID ();
65
58
CDynamicAddress walletAddress = CDynamicAddress (keyWalletID);
66
59
67
-
68
60
pwalletMain->SetAddressBook (keyWalletID, strObjectID, " bdap-wallet" );
69
61
70
62
CharString vchWalletAddress = vchFromString (walletAddress.ToString ());
71
63
txDomainEntry.WalletAddress = vchWalletAddress;
72
64
73
- // TODO: Add ability to pass in the DHT public key
74
- // CKeyEd25519 privDHTKey;
75
- // CharString vchDHTPubKey = privDHTKey.GetPubKey();
76
-
77
- // if (pwalletMain && !pwalletMain->AddDHTKey(privDHTKey, vchDHTPubKey))
78
- // throw std::runtime_error("BDAP_ADD_PUBLIC_ENTRY_RPC_ERROR: ERRCODE: 3503 - " + _("Error adding ed25519 key to wallet for BDAP"));
79
-
80
65
txDomainEntry.DHTPublicKey = vchDHTPubKey;
81
- CKeyID vchDHTPubKeyID = GetIdFromCharVector (vchDHTPubKey); // CKeyID(Hash160(vchDHTPubKey.begin(), vchDHTPubKey.end()));
82
- // pwalletMain->SetAddressBook(privDHTKey.GetID(), strObjectID, "bdap-dht-key"); //need private key for this?
66
+ CKeyID vchDHTPubKeyID = GetIdFromCharVector (vchDHTPubKey);
83
67
pwalletMain->SetAddressBook (vchDHTPubKeyID, strObjectID, " bdap-dht-key" );
84
68
85
- LogPrintf (" DEBUGGER ED %s - made it here! AFTER\n " , __func__);
86
-
87
-
88
-
89
69
// TODO: Add ability to pass in the link address
90
70
// TODO: Use stealth address for the link address so linking will be private
91
71
// now using GetKeyFromPool instead of MakeNewKey
@@ -94,13 +74,9 @@ static UniValue AddDomainEntry(const JSONRPCRequest& request, BDAP::ObjectType b
94
74
if (!pwalletMain->GetEdKeyFromPool (pubLinkKey, NAvchDHTPubKey, true ))
95
75
throw JSONRPCError (RPC_WALLET_KEYPOOL_RAN_OUT, " Error: EdKeypool ran out, please call edkeypoolrefill first" );
96
76
97
- // if (!pwalletMain->GetKeyFromPool(pubLinkKey, true))
98
- // throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
99
-
100
77
CKeyID keyLinkID = pubLinkKey.GetID ();
101
78
CDynamicAddress linkAddress = CDynamicAddress (keyLinkID);
102
79
103
-
104
80
pwalletMain->SetAddressBook (keyLinkID, strObjectID, " bdap-link" );
105
81
106
82
CharString vchLinkAddress = vchFromString (linkAddress.ToString ());
@@ -169,10 +145,6 @@ static UniValue AddDomainEntry(const JSONRPCRequest& request, BDAP::ObjectType b
169
145
std::string strPubKeyHash = GetHashFromCharVector (vchDHTPubKey).ToString ();
170
146
std::string strPubKeyID = GetIdFromCharVector (vchDHTPubKey).ToString ();
171
147
172
- LogPrintf (" DEBUGGER ED %s - GetHashFromCharVector [%s]\n " , __func__,strPubKeyHash);
173
- LogPrintf (" DEBUGGER ED %s - GetIdFromCharVector [%s]\n " , __func__,strPubKeyID);
174
-
175
-
176
148
oName.push_back (Pair (" dht_pubkey_hash" , strPubKeyHash));
177
149
oName.push_back (Pair (" dht_pubkey_id" , strPubKeyID));
178
150
return oName;
@@ -882,14 +854,10 @@ UniValue mybdapaccounts(const JSONRPCRequest& request)
882
854
if (!pwalletMain->GetDHTPubKeys (vvchDHTPubKeys))
883
855
return NullUniValue;
884
856
885
- LogPrintf (" DEBUGGER ED %s - size [%d]\n " ,__func__,vvchDHTPubKeys.size ());
886
-
887
-
888
857
UniValue result (UniValue::VOBJ);
889
858
uint32_t nCount = 1 ;
890
859
for (const std::vector<unsigned char >& vchPubKey : vvchDHTPubKeys) {
891
860
CDomainEntry entry;
892
- // LogPrintf("DEBUGGER ED %s - PubKey [%s]\n",__func__,stringFromVch(vchPubKey));
893
861
if (pDomainEntryDB->ReadDomainEntryPubKey (vchPubKey, entry)) {
894
862
UniValue oAccount (UniValue::VOBJ);
895
863
if (BuildBDAPJson (entry, oAccount, false )) {
0 commit comments