Skip to content

Commit

Permalink
reduce loop by 1 to avoid spam
Browse files Browse the repository at this point in the history
  • Loading branch information
galrogo committed Apr 27, 2021
1 parent bf4ed40 commit ab57e92
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go-tests/circularspam/circularspam.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func main() {

func invalidSpam(api *iota.NodeHTTPAPIClient, info *iota.NodeInfoResponse, triplets []KeyTriplet, signer iota.AddressSigner) {
//for each address
for i := 0; i < len(triplets); i++ {
for i := 0; i < len(triplets)-1; i++ {
txBuilder := iota.NewTransactionBuilder()
//query outputs in address
addr := &triplets[i].Address
Expand Down Expand Up @@ -103,7 +103,7 @@ func randAddress(tripletCopy []KeyTriplet) (iota.Ed25519Address, []KeyTriplet) {
}

func outOfOrderSpam(api *iota.NodeHTTPAPIClient, info *iota.NodeInfoResponse, triplets []KeyTriplet, signer iota.AddressSigner) {
size := len(triplets)
size := len(triplets) - 1

var futureIn []futInput
//for each address
Expand Down Expand Up @@ -182,7 +182,7 @@ func CreateSigner(triplets []KeyTriplet) iota.AddressSigner {
}

func circularSpam(api *iota.NodeHTTPAPIClient, info *iota.NodeInfoResponse, triplets []KeyTriplet, signer iota.AddressSigner) {
size := len(triplets)
size := len(triplets) - 1
//for each address
for i := 0; i < size; i++ {
txBuilder := iota.NewTransactionBuilder()
Expand All @@ -207,7 +207,7 @@ func circularSpam(api *iota.NodeHTTPAPIClient, info *iota.NodeInfoResponse, trip

func conflictingSpam(api *iota.NodeHTTPAPIClient, info *iota.NodeInfoResponse, triplets []KeyTriplet, signer iota.AddressSigner) {
//for each address
for i := 0; i < len(triplets); i++ {
for i := 0; i < len(triplets)-1; i++ {
tripletsCopy := make([]KeyTriplet, len(triplets))
//query outputs in address
addr := triplets[i].Address
Expand Down

0 comments on commit ab57e92

Please sign in to comment.