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