mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 18:02:54 +01:00
Request witness blocks from peers (#2289)
This commit is contained in:
parent
6c1992c116
commit
197367dc33
@ -126,9 +126,7 @@ class NeutrinoNodeWithWalletTest extends NodeUnitTest {
|
||||
)
|
||||
}
|
||||
|
||||
val countF = node.chainApiFromDb().flatMap(_.getFilterHeaderCount)
|
||||
for {
|
||||
count <- countF
|
||||
_ <- node.sync()
|
||||
_ <- NodeTestUtil.awaitSync(node, bitcoind)
|
||||
_ <- NodeTestUtil.awaitCompactFilterHeadersSync(node, bitcoind)
|
||||
@ -148,9 +146,8 @@ class NeutrinoNodeWithWalletTest extends NodeUnitTest {
|
||||
|
||||
// receive
|
||||
address <- wallet.getNewAddress()
|
||||
_ <-
|
||||
bitcoind
|
||||
.sendToAddress(address, TestAmount)
|
||||
txId <- bitcoind.sendToAddress(address, TestAmount)
|
||||
expectedTx <- bitcoind.getRawTransactionRaw(txId)
|
||||
|
||||
_ <-
|
||||
bitcoind.getNewAddress
|
||||
@ -159,7 +156,10 @@ class NeutrinoNodeWithWalletTest extends NodeUnitTest {
|
||||
_ <- NodeTestUtil.awaitCompactFiltersSync(node, bitcoind)
|
||||
|
||||
_ <- AsyncUtil.awaitConditionF(condition2)
|
||||
} yield succeed
|
||||
|
||||
// assert we got the full tx with witness data
|
||||
txs <- wallet.listTransactions()
|
||||
} yield assert(txs.exists(_.transaction == expectedTx))
|
||||
}
|
||||
|
||||
it must "watch an arbitrary SPK" taggedAs UsesExperimentalBitcoind in {
|
||||
|
@ -245,7 +245,7 @@ trait Node extends NodeApi with ChainQueryApi with P2PLogger {
|
||||
} else {
|
||||
for {
|
||||
peerMsgSender <- peerMsgSenderF
|
||||
_ <- peerMsgSender.sendGetDataMessage(TypeIdentifier.MsgBlock,
|
||||
_ <- peerMsgSender.sendGetDataMessage(TypeIdentifier.MsgWitnessBlock,
|
||||
blockHashes: _*)
|
||||
} yield ()
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ case class DataMessageHandler(
|
||||
case NodeType.SpvNode =>
|
||||
Inventory(TypeIdentifier.MsgFilteredBlock, hash)
|
||||
case NodeType.NeutrinoNode | NodeType.FullNode =>
|
||||
Inventory(TypeIdentifier.MsgBlock, hash)
|
||||
Inventory(TypeIdentifier.MsgWitnessBlock, hash)
|
||||
case NodeType.BitcoindBackend =>
|
||||
throw new RuntimeException("This is impossible")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user