walletdb: comments. minor.
This commit is contained in:
parent
ba0e62efd7
commit
7faba4a23b
@ -691,7 +691,7 @@ Account.prototype.syncDepth = co(function* syncDepth(receive, change, nested) {
|
||||
key = this.deriveChange(change - 1);
|
||||
yield this.saveKey(key);
|
||||
|
||||
this.change = this.deriveChange(change - 1);
|
||||
this.change = key;
|
||||
this.changeDepth = change;
|
||||
|
||||
derived = true;
|
||||
|
||||
@ -1164,8 +1164,8 @@ WalletDB.prototype.getPathMap = co(function* getPathMap(hash) {
|
||||
|
||||
/**
|
||||
* Save an address to the path map.
|
||||
* @param {WalletID} wid
|
||||
* @param {KeyRing[]} ring
|
||||
* @param {Wallet} wallet
|
||||
* @param {WalletKey} ring
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
@ -1177,11 +1177,12 @@ WalletDB.prototype.saveKey = function saveKey(wallet, ring) {
|
||||
* Save a path to the path map.
|
||||
*
|
||||
* The path map exists in the form of:
|
||||
* - `p[address-hash] -> wids`
|
||||
* - `P[wid][address-hash] -> path`
|
||||
* - `p[address-hash] -> wid map`
|
||||
* - `P[wid][address-hash] -> path data`
|
||||
* - `r[wid][account-index][address-hash] -> dummy`
|
||||
*
|
||||
* @param {WalletID} wid
|
||||
* @param {Path[]} path
|
||||
* @param {Wallet} wallet
|
||||
* @param {Path} path
|
||||
* @returns {Promise}
|
||||
*/
|
||||
|
||||
@ -1204,8 +1205,13 @@ WalletDB.prototype.savePath = co(function* savePath(wallet, path) {
|
||||
this.pathMapCache.set(hash, map);
|
||||
wallet.pathCache.push(hash, path);
|
||||
|
||||
// Address Hash -> Wallet Map
|
||||
batch.put(layout.p(hash), map.toRaw());
|
||||
|
||||
// Wallet ID + Address Hash -> Path Data
|
||||
batch.put(layout.P(wid, hash), path.toRaw());
|
||||
|
||||
// Wallet ID + Account Index + Address Hash -> Dummy
|
||||
batch.put(layout.r(wid, path.account, hash), DUMMY);
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user