BUG: In Sep 30 Release, build --tx --send never returns. It spins forever emitting "1 broadcast txs remaining". Possible FIX here:

No matter how much sync —nostop and also just sync I do at the console and with Control-c at stop cleanly shutdown before I try the build —tx —send, it still gets stuck on sending the A1 sometimes:
{“level”:“debug”,“ts”:1608805862.9190495,“logger”:“SpyNode”,“caller”:“handlers/untrusted_version.go:31”,“msg”:"([52.11.2.223]:8333) Version : /Bitcoin SV:1.0.3/ protocol 70015, blocks 666964"}
{“level”:“debug”,“ts”:1608805863.202109,“logger”:“SpyNode”,“caller”:“spynode/untrusted_node.go:338”,“msg”:"([52.11.2.223]:8333) Ready"}
{“level”:“debug”,“ts”:1608805863.2021928,“logger”:“SpyNode”,“caller”:“spynode/untrusted_node.go:434”,“msg”:"([52.11.2.223]:8333) Sending Tx : b4db9aa4f5626108b7dcb24c8db1d591f2d0a9230b96b69d77fa860326658c6e"}
{“level”:“info”,“ts”:1608805863.4812596,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805864.4822004,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805865.4824388,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805866.4828362,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805867.483592,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805868.4845607,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805869.484686,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805870.4851809,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805871.4853337,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805872.4865534,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805873.4866533,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805874.4868424,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“debug”,“ts”:1608805874.7378953,“logger”:“SpyNode”,“caller”:“spynode/node.go:980”,“msg”:“Untrusted connections : 99”}
{“level”:“debug”,“ts”:1608805874.7380755,“logger”:“SpyNode”,“caller”:“spynode/node.go:1073”,“msg”:“Found 181 peers with score 1”}
{“level”:“debug”,“ts”:1608805875.1848917,“logger”:“SpyNode”,“caller”:“handlers/untrusted_version.go:31”,“msg”:"([35.163.29.154]:8333) Version : /Bitcoin SV:1.0.1/ protocol 70015, blocks 666964"}
{“level”:“debug”,“ts”:1608805875.2817743,“logger”:“SpyNode”,“caller”:“spynode/untrusted_node.go:338”,“msg”:"([35.163.29.154]:8333) Ready"}
{“level”:“debug”,“ts”:1608805875.2819376,“logger”:“SpyNode”,“caller”:“spynode/untrusted_node.go:434”,“msg”:"([35.163.29.154]:8333) Sending Tx : b4db9aa4f5626108b7dcb24c8db1d591f2d0a9230b96b69d77fa860326658c6e"}
{“level”:“info”,“ts”:1608805875.4870913,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805876.4874432,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805877.4883175,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805878.4884322,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805879.489204,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
{“level”:“info”,“ts”:1608805880.4894927,“logger”:“SpyNode”,“caller”:“spynode/node.go:476”,“msg”:“1 broadcast txs remaining”}
.
forever…

THIS LOOKS LIKE A BUG AND IS MAYBE THE ROOT CAUSE:
IN Master branch of Sep 30 Release: pkg/spynode/node.go line 1017:
// tx has been sent to enough nodes. remove it
node.broadcastTxs = append(node.broadcastTxs[:1], node.broadcastTxs[i+1:]…)
the [:1] is a typo
SHOULD BE
[:i]
That is to say, put the variable “i” there, not the digit "1

Research for this bug fix:
google “golang how to remove an item from an array”


a := []string{“A”, “B”, “C”, “D”, “E”}
i := 2

// Remove the element at index i from a.
copy(a[i:], a[i+1:]) // Shift a[i+1:] left one index.
a[len(a)-1] = “” // Erase last element (write zero value).
a = a[:len(a)-1] // Truncate slice.

fmt.Println(a) // [A B D E]

SUGGESTION:
DON’T DO THIS PHYSICAL DELETE APPROACH.
JUST PUT A LOGICAL DELETE FEATURE INTO IT BY ADDING an “Active” flag into the node and setting it false to logically remove it, and change all the access logic to look at the active flag.

Thanks for finding that. I don’t think it has been causing us direct problems because of the way we use it. It should be fixed in the latest release. https://github.com/tokenized/pkg/releases/tag/v0.2.2