In some cases, like when an account is closed due to participating in a
batch, the latest transaction stored for the account is unsigned, which
can be rebroadcast upon a restart. This broadcast attempt will always
fail, so instead we opt to not rebroadcast it at all.
Instead of deleting the partial order (which had a bug in it that it
didn't remove the order creation timestamp) we for now only update its
status to failed. We'll want to implement proper housekeeping at one
point to get rid of archived orders. But for now we have the
--active_only flag that helps to easily filter out archived orders on
the command line.
In this commit, we add a new key within the order bucket that stores
just the node tier for a given order. The current code only _expects_ a
node tier to exist for Bid orders, however things have been designed
such that, we can easily add tier options for Ask orders as well.
Along the way we modify the `orderCallback` to include the node tier
information as its read from a distinct bucket. In the future, we'll
likely want to make this into a struct so the function signature doesn't
ever expand.
When a terminal error is received, it is not enough to stop the server
itself to terminate the trader daemon because the main goroutine still
blocks on the read from the shutdown channel.
Instead we have to request a proper shutdown through the signal package
to initiate a full trader daemon stop.
In this commit, we introduce a new field to only bids (for now): a min
node tier. This node tier is meant to allow buyers to express the level
of "quality" they're interested in for a given purchased channel. This
quality is determined using the current server-side rating system. The
base node tier are those considered "above the cut", this is also the
default tier: t1. The next node tier is t0, and is the buckets all other
nodes fall in. As the tiers rise, the number of nodes in each tier
shrinks, as these are meant to be the upper percentile of all nodes.
NOTE: The way this is implemented is actually a _breaking change_ from
the perspective of orders as we add a new field, which is included in
the order digest, without also bumping the version.