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 =
|
||||
if (mather == Selector.empty) {
|
||||
head
|
||||
} else {
|
||||
filteredHeads.computeIfAbsent(mather.describeInternal().intern()) { _ ->
|
||||
upstreams.filter { mather.matches(it) }
|
||||
.apply {
|
||||
@@ -168,12 +171,17 @@ open class EthereumPosMultiStream(
|
||||
when (it.size) {
|
||||
0 -> EmptyHead()
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getFeeEstimation(): ChainFees {
|
||||
return feeEstimation
|
||||
|
||||
Reference in New Issue
Block a user