There is an assert in `CWalletTx::RelayWalletTransaction` that gets hit.  All other code paths check `fBroadcastTransactions` before getting to `CWallet::ResendWalletTransactionsBefore` except the rpc call `resendwalletransactions`.

It's an easy fix, but we just need to decide whether to throw an error or return an empty array of rebroadcasted transaction ids.

Should be fixed for 0.15.
{
    CKey key;
    key.MakeNewKey(true);
    int64_t nCreationTime = GetTime();
    CKeyMetadata metadata(nCreationTime);
    
    CPubKey pubkey = key.GetPubKey();
    assert(key.VerifyPubKey(pubkey));
    
    metadata.hdKeypath     = "m";
    metadata.hdMasterKeyID = pubkey.GetID();
    {
        LOCK(cs_wallet);
        
        mapKeyMetadata[pubkey.GetID()] = metadata;
        
        if (!AddKeyPubKey(key, pubkey))
            throw std::runtime_error(std::string(__func__) + ": AddKeyPubKey failed");
    }
    return pubkey;
}
bool CWallet::SetHDMasterKey(const CPubKey& pubkey)