Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont distinct channel, only debounce, always send latest PFSCapacityUpdate #1127

Merged
merged 1 commit into from
Mar 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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