Skip to content

Commit

Permalink
Fixes race condition in TestNode_MiningSpamTransactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
web3coach committed Jun 6, 2021
1 parent 421951b commit 54d738a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions node/node_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,13 @@ func TestNode_MiningSpamTransactions(t *testing.T) {
// Wait for the node to run and initialize its state and other components
time.Sleep(time.Second)

now := uint64(time.Now().Unix())
// Schedule 4 transfers from Andrej -> BabaYaga
for i := uint(1); i <= txCount; i++ {
// Ensure every TX has a unique timestamp
time.Sleep(time.Second)

txNonce := i
tx := database.NewTx(andrej, babaYaga, txValue, txNonce, "")
// Ensure every TX has a unique timestamp and the nonce 0 has oldest timestamp, nonce 1 younger timestamp etc
tx.Time = now - uint64(txCount-i*100)

signedTx, err := wallet.SignTxWithKeystoreAccount(tx, andrej, testKsAccountsPwd, wallet.GetKeystoreDirPath(dataDir))
if err != nil {
Expand Down

0 comments on commit 54d738a

Please sign in to comment.