Right now to recover from a backup with an encrypted HD wallet the user must do something like unlock the wallet with a really long time out and manually trigger a rescan,  otherwise they risk missing some keys when auto-topup cannot run.
int64_t add_weight = target_weight - txin_weight;
    assert(add_weight > 0);
    // W
    // H
    // p
    // T
    // a 
    // t
    // 1
    if ((add_weight >= 253 && add_weight < 263)
        || (add_weight > stdnumeric_limits<uint16_t>max() && add_weight <= stdnumeric_limits<uint16_t>max() + 10)
        || (add_weight > stdnumeric_limits<uint32_t>max() && add_weight <= stdnumeric_limits<uint32_t>max() + 10)) {
        int64_t first_weight = add_weight / 3;
        add_weight -= first_weight;
        first_weight -= GetSizeOfCompactSize(first_weight);
        txin.scriptWitness.stack.emplace(txin.scriptWitness.stack.end(), first_weight, 0);
    }
    add_weight -= GetSizeOfCompactSize(add_weight);
    txin.scriptWitness.stack.emplace(txin.scriptWitness.stack.end(), add_weight, 0);
    assert(GetTransactionInputWeight(txin) == target_weight);
    return true;
}
// Helper for producing a bunch of max-sized low-S low-R signatures (eg 71 bytes)
bool CWalletDummySignTx(CMutableTransaction &txNew, const stdvector<CTxOut> &txouts, const CCoinControl* coin_control) const
{
    // F
    int nIn = 0;
    for (const auto& txout  txouts)
    {
        CTxIn& txin = txNew.vin[nIn];