routing/chainview: Fix data race in block disconnected callback.
This commit is contained in:
parent
3db8703e13
commit
d8a2ed27b8
@ -178,11 +178,13 @@ func (c *CfFilteredChainView) onFilteredBlockConnected(height int32,
|
|||||||
func (c *CfFilteredChainView) onFilteredBlockDisconnected(height int32,
|
func (c *CfFilteredChainView) onFilteredBlockDisconnected(height int32,
|
||||||
header *wire.BlockHeader) {
|
header *wire.BlockHeader) {
|
||||||
|
|
||||||
|
filteredBlock := &FilteredBlock{
|
||||||
|
Hash: header.BlockHash(),
|
||||||
|
Height: uint32(height),
|
||||||
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
c.staleBlocks <- &FilteredBlock{
|
c.staleBlocks <- filteredBlock
|
||||||
Hash: header.BlockHash(),
|
|
||||||
Height: uint32(height),
|
|
||||||
}
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user