class/User.js
/**
   * Asks LND for new address, and imports it to bitcoind
   *
   * @returns {Promise<any>}
   */
Asks LND for new address, and imports it to bitcoind
@returns {Promise}
Asks LND for new address and imports it to bitcoind @returns { Promise }
async generateAddress() {
    let lock = new Lock(this._redis, 'generating_address_' + this._userid);
    if (!(await lock.obtainLock())) {
      return;
    }
    let self = this;
    return new Promise(function (resolve, reject) {
      self._lightning.newAddress({ type: 0 }, async function (err, response) {
        if (err) return reject('LND failure when trying to generate new address');
        await self.addAddress(response.address);
        if (config.bitcoind) self._bitcoindrpc.request('importaddress', [response.address, response.address, false]);
        resolve();
      });
    });
  }
async generateAddress ( ) { let lock = new Lock ( this . _redis , 'generating_address_' + this . _userid ) ; if ( ! ( await lock . obtainLock ( ) ) ) { return ; } let self = this ; return new Promise ( function ( resolve , reject ) { self . _lightning . newAddress ( { type : 0 } , async function ( err , response ) { if ( err ) return reject ( 'LND failure when trying to generate new address' ) ; await self . addAddress ( response . address ) ; if ( config . bitcoind ) self . _bitcoindrpc . request ( 'importaddress' , [ response . address , response . address , false ] ) ; resolve ( ) ; } ) ; } ) ; }
Asks LND for new address, and imports it to bitcoind
 @returns {Promise<any>}
Asks LND for new address and imports it to bitcoind @returns { Promise<any > }
// someone's already generating address