lightninglabs / neutrino

Privacy-Preserving Bitcoin Light Client
MIT License
908 stars 183 forks source link

pushtx/broadcaster: make rebroadcast tx async #150

Closed halseth closed 5 years ago

halseth commented 5 years ago

This commit makes the rebroadcast logic being run in a goroutine. This is done to ensure we don't block the whole broadcast loop while performing a rebroadcast.

Rebroadcasts can be slow if the number of transactions are large (each broadcast has a timeout of 0.5s), which would cause publishing new transactions to block. With this commit we let the rebroadcast continue in the background, while we can keep pushing new txs.

TODO

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.09%) to 68.43% when pulling 6f292a7e2f35c763acb2609116c4f9f22a37553b on halseth:push-tx-async-rebroadcast into a655679fe131a5d1b4417872cc834fc3862ac70e on lightninglabs:master.