How to make a persistent SPV wallet? (bcoin)
As commented here, the cause of the problem is that I


  sorta have created two wallets. The first is instantiated by the plugin statement towards the top, and then you also create a new walletDB right after.


So the solution is using WalletClient:

const {WalletClient} = require('bclient');
const {Network} = require('bcoin');
const network = Network.get('regtest');

const walletOptions = {
  network: network.type,
  port: network.walletPort,
  apiKey: 'api-key'
}

const walletClient = new WalletClient(walletOptions);
const id = 'primary'; // or whatever your wallet name is
const wallet = walletClient.wallet(id);


Instead of walletdb.create().