diff --git a/src/wallet.cpp b/src/wallet.cpp index f2758535..5f7cddf5 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1320,7 +1320,10 @@ vector CReserveKey::GetReservedKey() { CKeyPool keypool; pwallet->ReserveKeyFromKeyPool(nIndex, keypool); - vchPubKey = keypool.vchPubKey; + if (nIndex != -1) + vchPubKey = keypool.vchPubKey; + else + vchPubKey = vchDefaultKey; } assert(!vchPubKey.empty()); return vchPubKey;