diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba073af634c..89c21bc357e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: run: make check - name: Upload Test Suite Log - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: failure() with: name: test-suite-log diff --git a/src/wallet/scriptpubkeyman.cpp b/src/wallet/scriptpubkeyman.cpp index 8c161b72f0a..9ced1d03ee9 100644 --- a/src/wallet/scriptpubkeyman.cpp +++ b/src/wallet/scriptpubkeyman.cpp @@ -375,11 +375,18 @@ void LegacyScriptPubKeyMan::MarkUnusedAddresses(const CScript& script) if (it != mapKeyMetadata.end()){ CKeyMetadata meta = it->second; if (!meta.hd_seed_id.IsNull() && meta.hd_seed_id != m_hd_chain.seed_id) { - bool internal = (meta.key_origin.path[1] & ~BIP32_HARDENED_KEY_LIMIT) != 0; - int64_t index = meta.key_origin.path[2] & ~BIP32_HARDENED_KEY_LIMIT; - - if (!TopUpInactiveHDChain(meta.hd_seed_id, index, internal)) { - WalletLogPrintf("%s: Adding inactive seed keys failed\n", __func__); + if (meta.key_origin.path.size() < 3) { + WalletLogPrintf("%s: Adding inactive seed keys failed, insufficient path size: %d, has_key_origin: %s\n", + __func__, + meta.key_origin.path.size(), + meta.has_key_origin); + } else { + bool internal = (meta.key_origin.path[1] & ~BIP32_HARDENED_KEY_LIMIT) != 0; + int64_t index = meta.key_origin.path[2] & ~BIP32_HARDENED_KEY_LIMIT; + + if (!TopUpInactiveHDChain(meta.hd_seed_id, index, internal)) { + WalletLogPrintf("%s: Adding inactive seed keys failed\n", __func__); + } } } }