diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index f392649bd9f..3e99d145d89 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -556,9 +556,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, } if (internal) { chain.nVersion = CHDChain::VERSION_HD_CHAIN_SPLIT; - chain.nInternalChainCounter = std::max(chain.nInternalChainCounter, index); + chain.nInternalChainCounter = std::max(chain.nInternalChainCounter, index + 1); } else { - chain.nExternalChainCounter = std::max(chain.nExternalChainCounter, index); + chain.nExternalChainCounter = std::max(chain.nExternalChainCounter, index + 1); } } } else if (strType == DBKeys::WATCHMETA) {