In case empty selector in SubscribeNative we should use default dynamic merged head. (#172)
This commit is contained in:
@@ -158,6 +158,9 @@ open class EthereumPosMultiStream(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun getHead(mather: Selector.Matcher): Head =
|
override fun getHead(mather: Selector.Matcher): Head =
|
||||||
|
if (mather == Selector.empty) {
|
||||||
|
head
|
||||||
|
} else {
|
||||||
filteredHeads.computeIfAbsent(mather.describeInternal().intern()) { _ ->
|
filteredHeads.computeIfAbsent(mather.describeInternal().intern()) { _ ->
|
||||||
upstreams.filter { mather.matches(it) }
|
upstreams.filter { mather.matches(it) }
|
||||||
.apply {
|
.apply {
|
||||||
@@ -168,12 +171,17 @@ open class EthereumPosMultiStream(
|
|||||||
when (it.size) {
|
when (it.size) {
|
||||||
0 -> EmptyHead()
|
0 -> EmptyHead()
|
||||||
1 -> selected.first()
|
1 -> selected.first()
|
||||||
else -> MergedHead(selected, PriorityForkChoice(), "ETH head for ${it.map { it.getId() }}").apply {
|
else -> MergedHead(
|
||||||
|
selected,
|
||||||
|
PriorityForkChoice(),
|
||||||
|
"ETH head for ${it.map { it.getId() }}"
|
||||||
|
).apply {
|
||||||
start()
|
start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun getFeeEstimation(): ChainFees {
|
override fun getFeeEstimation(): ChainFees {
|
||||||
return feeEstimation
|
return feeEstimation
|
||||||
|
|||||||
Reference in New Issue
Block a user