| 3942 | } |
| 3943 | |
| 3944 | bool CReserveKey::GetReservedKey(CPubKey& pubkey, bool internal) |
| 3945 | { |
| 3946 | if (nIndex == -1) { |
| 3947 | CKeyPool keypool; |
| 3948 | pwallet->ReserveKeyFromKeyPool(nIndex, keypool, internal); |
| 3949 | if (nIndex != -1) { |
| 3950 | vchPubKey = keypool.vchPubKey; |
| 3951 | } else { |
| 3952 | return false; |
| 3953 | } |
| 3954 | //vchPubKey = keypool.vchPubKey; |
| 3955 | internal = keypool.internal; |
| 3956 | } |
| 3957 | |
| 3958 | if(!vchPubKey.IsValid()) { |
| 3959 | LogPrintf("%s: vchPubKey is invalid\n", __func__); |
| 3960 | return false; |
| 3961 | } |
| 3962 | pubkey = vchPubKey; |
| 3963 | return true; |
| 3964 | } |
| 3965 | |
| 3966 | void CReserveKey::KeepKey() |
| 3967 | { |
no test coverage detected