Skip to content

Commit 2485d09

Browse files
authored
downloader: fix comment (#32382)
The previous comment stated that every 3rd block has a tx and every 5th has an uncle. The implementation actually adds one transaction to every second block and does not add uncles. Updated the comment to reflect the real behavior to avoid confusion when reading tests.
1 parent 6238eff commit 2485d09

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

eth/downloader/queue_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ import (
3636
)
3737

3838
// makeChain creates a chain of n blocks starting at and including parent.
39-
// the returned hash chain is ordered head->parent. In addition, every 3rd block
40-
// contains a transaction and every 5th an uncle to allow testing correct block
41-
// reassembly.
39+
// The returned hash chain is ordered head->parent.
40+
// If empty is false, every second block (i%2==0) contains one transaction.
41+
// No uncles are added.
4242
func makeChain(n int, seed byte, parent *types.Block, empty bool) ([]*types.Block, []types.Receipts) {
4343
blocks, receipts := core.GenerateChain(params.TestChainConfig, parent, ethash.NewFaker(), testDB, n, func(i int, block *core.BlockGen) {
4444
block.SetCoinbase(common.Address{seed})
45-
// Add one tx to every secondblock
45+
// Add one tx to every second block
4646
if !empty && i%2 == 0 {
4747
signer := types.MakeSigner(params.TestChainConfig, block.Number(), block.Timestamp())
4848
tx, err := types.SignTx(types.NewTransaction(block.TxNonce(testAddress), common.Address{seed}, big.NewInt(1000), params.TxGas, block.BaseFee(), nil), signer, testKey)

0 commit comments

Comments
 (0)