| 677 | } |
| 678 | |
| 679 | s64 wallet_get_newindex(struct lightningd *ld) |
| 680 | { |
| 681 | u64 newidx = db_get_intvar(ld->wallet->db, "bip32_max_index", 0) + 1; |
| 682 | |
| 683 | if (newidx == BIP32_INITIAL_HARDENED_CHILD) |
| 684 | return -1; |
| 685 | |
| 686 | db_set_intvar(ld->wallet->db, "bip32_max_index", newidx); |
| 687 | return newidx; |
| 688 | } |
| 689 | |
| 690 | static void wallet_shachain_init(struct wallet *wallet, |
| 691 | struct wallet_shachain *chain) |
no test coverage detected