diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/types')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go index 3222b3c2f..89dfef3fd 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/types/nodeset.go @@ -100,6 +100,9 @@ func (ns *NodeSet) Clone() *NodeSet { // GetSubSet returns the subset of given target. func (ns *NodeSet) GetSubSet( size int, target SubSetTarget) map[NodeID]struct{} { + if size == 0 { + return make(map[NodeID]struct{}) + } h := rankHeap{} idx := 0 for nID := range ns.IDs { |