2021-10-17 10:36:14 +02:00
|
|
|
import { createSelector } from 'reselect';
|
|
|
|
|
2021-10-23 04:41:43 +02:00
|
|
|
export const selectState = (state) => state.blacklist || {};
|
2021-10-17 10:36:14 +02:00
|
|
|
|
2021-10-23 04:41:43 +02:00
|
|
|
export const selectBlackListedOutpoints = (state) => selectState(state).blackListedOutpoints;
|
2021-10-17 10:36:14 +02:00
|
|
|
|
2021-10-23 04:41:43 +02:00
|
|
|
export const selectBlacklistedOutpointMap = createSelector(selectBlackListedOutpoints, (outpoints) =>
|
|
|
|
outpoints
|
|
|
|
? outpoints.reduce((acc, val) => {
|
|
|
|
const outpoint = `${val.txid}:${val.nout}`;
|
|
|
|
acc[outpoint] = 1;
|
|
|
|
return acc;
|
|
|
|
}, {})
|
|
|
|
: {}
|
2021-10-17 10:36:14 +02:00
|
|
|
);
|