From 2d09d2af33e429fa0339849a8d9526da09578138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Vitor=20de=20Lima=20Matos?= Date: Tue, 3 Mar 2020 18:54:24 -0300 Subject: [PATCH] Dont distinct channel, only debounce, always send latest PFSCapacityUpdate --- raiden-ts/src/path/epics.ts | 10 +++------- raiden-ts/src/raiden.ts | 1 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/raiden-ts/src/path/epics.ts b/raiden-ts/src/path/epics.ts index bbee9929b5..bb8161646d 100644 --- a/raiden-ts/src/path/epics.ts +++ b/raiden-ts/src/path/epics.ts @@ -18,7 +18,6 @@ import { tap, timeout, withLatestFrom, - distinctUntilKeyChanged, } from 'rxjs/operators'; import { fromFetch } from 'rxjs/fetch'; import { Signer } from 'ethers'; @@ -419,14 +418,11 @@ export const pfsCapacityUpdateEpic = ( grouped$.pipe( withLatestFrom(config$), filter(([, { pfsRoom }]) => !!pfsRoom), // ignore actions while/if config.pfsRoom isn't set - debounceTime(httpTimeout / 3), // default: 10s - map(([channel, config]) => ({ channel, capacities: channelAmounts(channel), config })), - // distinct on ownCapacity change - distinctUntilKeyChanged('capacities', (a, b) => a.ownCapacity.eq(b.ownCapacity)), - concatMap(({ channel, capacities, config: { revealTimeout, pfsRoom } }) => { + debounceTime(httpTimeout / 2), // default: 15s + concatMap(([channel, { revealTimeout, pfsRoom }]) => { const { tokenNetwork, partnerAddr: partner } = channel; if (channel.state !== ChannelState.open) return EMPTY; - const { ownCapacity, partnerCapacity } = capacities; + const { ownCapacity, partnerCapacity } = channelAmounts(channel); const message: PFSCapacityUpdate = { type: MessageType.PFS_CAPACITY_UPDATE, diff --git a/raiden-ts/src/raiden.ts b/raiden-ts/src/raiden.ts index 80e68f9fa5..e60904d489 100644 --- a/raiden-ts/src/raiden.ts +++ b/raiden-ts/src/raiden.ts @@ -954,7 +954,6 @@ export class Raiden { if (!receipt.status) throw new RaidenError(ErrorCodes.RDN_MINT_FAILED, { transactionHash: tx.hash! }); - await waitConfirmation(receipt, this.deps); return tx.hash as Hash; }