mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 01:40:55 +01:00
Add rpc for syncwithvalidationinterfacequeue, use it in NodeUnitTest.syncNeutrinoNode (#4983)
This commit is contained in:
parent
0ff1370bf9
commit
b329c3670e
@ -253,4 +253,12 @@ trait BlockchainRpc { self: Client =>
|
||||
bitcoindCall[Boolean]("verifychain",
|
||||
List(JsNumber(level), JsNumber(blocks)))
|
||||
}
|
||||
|
||||
/** Waits for the validation interface queue to catch up on everything that was there when we entered this function
|
||||
* @see [[https://github.com/bitcoin/bitcoin/issues/27085]]
|
||||
* @return
|
||||
*/
|
||||
def syncWithValidationInterfaceQueue(): Future[Unit] = {
|
||||
bitcoindCall[Unit](command = "syncwithvalidationinterfacequeue", List.empty)
|
||||
}
|
||||
}
|
||||
|
@ -532,6 +532,10 @@ object NodeUnitTest extends P2PLogger {
|
||||
system: ActorSystem): Future[NeutrinoNode] = {
|
||||
import system.dispatcher
|
||||
for {
|
||||
//wait for bitcoind to be synced internally
|
||||
//see: https://github.com/bitcoin/bitcoin/issues/27085
|
||||
//see: https://github.com/bitcoin-s/bitcoin-s/issues/4976
|
||||
_ <- bitcoind.syncWithValidationInterfaceQueue()
|
||||
_ <- node.sync()
|
||||
syncing <- node.chainApiFromDb().flatMap(_.isSyncing())
|
||||
_ = require(syncing)
|
||||
|
Loading…
Reference in New Issue
Block a user