| 219 | } |
| 220 | |
| 221 | bool WalletBatch::WriteDescriptorKey(const uint256& desc_id, const CPubKey& pubkey, const CPrivKey& privkey) |
| 222 | { |
| 223 | // hash pubkey/privkey to accelerate wallet load |
| 224 | std::vector<unsigned char> key; |
| 225 | key.reserve(pubkey.size() + privkey.size()); |
| 226 | key.insert(key.end(), pubkey.begin(), pubkey.end()); |
| 227 | key.insert(key.end(), privkey.begin(), privkey.end()); |
| 228 | |
| 229 | return WriteIC(std::make_pair(DBKeys::WALLETDESCRIPTORKEY, std::make_pair(desc_id, pubkey)), std::make_pair(privkey, Hash(key)), false); |
| 230 | } |
| 231 | |
| 232 | bool WalletBatch::WriteCryptedDescriptorKey(const uint256& desc_id, const CPubKey& pubkey, const std::vector<unsigned char>& secret) |
| 233 | { |