routing/chainview: make filter updates synchronous for neutrino

This commit fixes a possible race condition wherein a call to
FilterBlock after a call to UpdateFilter would result in the call to
FilterBlock not yet using the updated filter. We fix this by ensuring
the internal chain filter is updated by the time the call to
FilterBlock returns.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-06-09 12:18:33 -07:00
1 parent 0c134a8cb3
commit e4563ca13b
2 files changed
+22 -8

No files matched your search

+1
View File
@@ -361,6 +361,7 @@ func (b *BtcdFilteredChainView) chainFilterer() {
type filterUpdate struct {
newUtxos []wire.OutPoint
updateHeight uint32
done chan struct{}
}
// UpdateFilter updates the UTXO filter which is to be consulted when creating