From 554ae0dbbbe15f638bd7a105b5c4ad6888875129 Mon Sep 17 00:00:00 2001 From: Chris Schinnerl Date: Mon, 12 Aug 2024 14:30:10 +0200 Subject: [PATCH] bus: broadcast block outline --- bus/bus.go | 4 ++++ internal/node/syncer.go | 1 + 2 files changed, 5 insertions(+) diff --git a/bus/bus.go b/bus/bus.go index 2e50c7e9b..30d9b0db8 100644 --- a/bus/bus.go +++ b/bus/bus.go @@ -65,6 +65,7 @@ type ( Block(id types.BlockID) (types.Block, bool) PoolTransaction(txid types.TransactionID) (types.Transaction, bool) PoolTransactions() []types.Transaction + V2PoolTransactions() []types.V2Transaction RecommendedFee() types.Currency TipState() consensus.State UnconfirmedParents(txn types.Transaction) []types.Transaction @@ -206,6 +207,7 @@ type ( Syncer interface { Addr() string BroadcastHeader(h gateway.BlockHeader) + BroadcastV2BlockOutline(bo gateway.V2BlockOutline) BroadcastTransactionSet([]types.Transaction) BroadcastV2TransactionSet(index types.ChainIndex, txns []types.V2Transaction) Connect(ctx context.Context, addr string) (*syncer.Peer, error) @@ -456,6 +458,8 @@ func (b *bus) consensusAcceptBlock(jc jape.Context) { Timestamp: block.Timestamp, MerkleRoot: block.MerkleRoot(), }) + } else { + b.s.BroadcastV2BlockOutline(gateway.OutlineBlock(block, b.cm.PoolTransactions(), b.cm.V2PoolTransactions())) } } diff --git a/internal/node/syncer.go b/internal/node/syncer.go index 354850015..b8f0bff41 100644 --- a/internal/node/syncer.go +++ b/internal/node/syncer.go @@ -18,6 +18,7 @@ type Syncer interface { io.Closer Addr() string BroadcastHeader(h gateway.BlockHeader) + BroadcastV2BlockOutline(bo gateway.V2BlockOutline) BroadcastTransactionSet([]types.Transaction) BroadcastV2TransactionSet(index types.ChainIndex, txns []types.V2Transaction) Connect(ctx context.Context, addr string) (*syncer.Peer, error)