Skip to content

Commit

Permalink
Dont distinct channel, only debounce, always send latest PFSCapacityU…
Browse files Browse the repository at this point in the history
…pdate
  • Loading branch information
andrevmatos committed Mar 3, 2020
1 parent e11c666 commit b44bd0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
10 changes: 3 additions & 7 deletions raiden-ts/src/path/epics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
tap,
timeout,
withLatestFrom,
distinctUntilKeyChanged,
} from 'rxjs/operators';
import { fromFetch } from 'rxjs/fetch';
import { Signer } from 'ethers';
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion raiden-ts/src/raiden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit b44bd0c

Please sign in to comment.