diff options
Diffstat (limited to 'src/db.h')
| -rw-r--r-- | src/db.h | 27 |
1 files changed, 25 insertions, 2 deletions
| @@ -392,8 +392,11 @@ public: | |||
| 392 | // twelve words are the user's to write down, and keeping a copy of them in | 392 | // twelve words are the user's to write down, and keeping a copy of them in |
| 393 | // the file they are meant to protect defeats the point of having them. | 393 | // the file they are meant to protect defeats the point of having them. |
| 394 | // | 394 | // |
| 395 | // "hdnext" is the next child index to derive, so the sequence a restore | 395 | // "hdschema" identifies the derivation layout. Wallets created before the |
| 396 | // reproduces is the same one this wallet handed out. | 396 | // field existed are inferred as HD_SCHEMA_LEGACY when a seed is present. |
| 397 | // "hdnext" is that legacy layout's next child index. The receive/change | ||
| 398 | // counters and coin type are reserved for the BIP44 layout that uses | ||
| 399 | // separate chains. | ||
| 397 | bool ReadHDMaster(vector<unsigned char>& vchMasterRet, vector<unsigned char>& vchChainCodeRet) | 400 | bool ReadHDMaster(vector<unsigned char>& vchMasterRet, vector<unsigned char>& vchChainCodeRet) |
| 398 | { | 401 | { |
| 399 | vchMasterRet.clear(); | 402 | vchMasterRet.clear(); |
| @@ -413,6 +416,26 @@ public: | |||
| 413 | return Write(string("hdnext"), nNext); | 416 | return Write(string("hdnext"), nNext); |
| 414 | } | 417 | } |
| 415 | 418 | ||
| 419 | bool WriteHDSchema(int nSchema) | ||
| 420 | { | ||
| 421 | return Write(string("hdschema"), nSchema); | ||
| 422 | } | ||
| 423 | |||
| 424 | bool WriteHDCoinType(unsigned int nCoinType) | ||
| 425 | { | ||
| 426 | return Write(string("hdcointype"), nCoinType); | ||
| 427 | } | ||
| 428 | |||
| 429 | bool WriteHDReceiveNext(unsigned int nNext) | ||
| 430 | { | ||
| 431 | return Write(string("hdreceivenext"), nNext); | ||
| 432 | } | ||
| 433 | |||
| 434 | bool WriteHDChangeNext(unsigned int nNext) | ||
| 435 | { | ||
| 436 | return Write(string("hdchangenext"), nNext); | ||
| 437 | } | ||
| 438 | |||
| 416 | // Keys generated ahead of time and not yet handed out. The private key of | 439 | // Keys generated ahead of time and not yet handed out. The private key of |
| 417 | // each is already stored under its own "key" record by AddKey; a "pool" | 440 | // each is already stored under its own "key" record by AddKey; a "pool" |
| 418 | // record only says that this one is still unspoken for. | 441 | // record only says that this one is still unspoken for. |