Skip to content

Some Improvements

David Vorick requested to merge negotiate-refine into renter-host-upgrades

I really meant to PR this as soon as the form contract negotiation code was cleaned up, but then I fell down a rabbit hole when I told myself 'well, I'll just clean up this one netAddress thing'. I should have committed code before doing that, and I'm sorry that this isn't organized better. It was pretty avoidable.

That said, I do think that this PR contains a significant number of improvements to the code quality and overall structure of the host. I will explain how the netAddress stuff works:

The host has two fields for the net address. The first is host.autoAddress and the second is host.settings.NetAddress. The settings address is only set if the user has set it manually. They are both saved in the host persistence. If the settings address is not set, then the host will fall back to the auto address, which it gets by periodically (every 30 minutes) checking its hostname. If at any point the hostname changes, the host will add another host announcement to the blockchain.

The host will not automatically announce to the blockchain when the address is set manually, but the host can report whether or not an announcement has been submitted to the transaction pool. This is a bit short of being able to tell whether the announcement made it to the blockchain, but since there are fees I'm not sure what the best response is. The host does make announcements with a fairly high transaction fee, so I would think it likely that the host does succeed.

Then again, the existing transaction pool is not that intelligent.

Merge request reports