mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 10:13:26 +01:00
2022 12 29 issue 4933 (#4935)
* Add unit test * revert logging levels * Empty commit
This commit is contained in:
parent
746e23cf86
commit
e7dd96468d
@ -2,6 +2,7 @@ package org.bitcoins.node
|
||||
|
||||
import akka.actor.Cancellable
|
||||
import org.bitcoins.asyncutil.AsyncUtil
|
||||
import org.bitcoins.chain.models.{CompactFilterDAO, CompactFilterHeaderDAO}
|
||||
import org.bitcoins.core.util.NetworkUtil
|
||||
import org.bitcoins.crypto.DoubleSha256DigestBE
|
||||
import org.bitcoins.node.models.{Peer, PeerDAO, PeerDb}
|
||||
@ -271,4 +272,31 @@ class NeutrinoNodeTest extends NodeTestWithCachedBitcoindPair {
|
||||
succeed
|
||||
}
|
||||
}
|
||||
|
||||
it must "start syncing compact filter headers / compact filters when block header is seen" in {
|
||||
nodeConnectedWithBitcoind: NeutrinoNodeConnectedWithBitcoinds =>
|
||||
//see: https://github.com/bitcoin-s/bitcoin-s/issues/4933
|
||||
val node = nodeConnectedWithBitcoind.node
|
||||
val bitcoind = nodeConnectedWithBitcoind.bitcoinds(0)
|
||||
|
||||
for {
|
||||
_ <- NodeUnitTest.syncNeutrinoNode(node, bitcoind)
|
||||
_ <- node.stop()
|
||||
//drop all compact filter headers / filters
|
||||
_ <- CompactFilterHeaderDAO()(executionContext, node.chainConfig)
|
||||
.deleteAll()
|
||||
_ <- CompactFilterDAO()(executionContext, node.chainConfig).deleteAll()
|
||||
_ <- bitcoind.generate(1)
|
||||
//restart the node
|
||||
_ <- node.start()
|
||||
_ <- node.sync()
|
||||
//await for us to sync compact filter headers filters
|
||||
//the sync process should get kicked off after we see the
|
||||
//newly mined block header
|
||||
_ <- NodeTestUtil.awaitAllSync(node, bitcoind)
|
||||
} yield {
|
||||
succeed
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user