* Previously both searchrawtransaction and getrawtransaction would omit
the 'Confirmations' field by default if the transaction was found in
the mempool.
* By removing `omitempty`, a mempool transaction will now have
'Confirmations:0'
Also update to use the new container-based builds
For now, golint has been disabled since it fails due to wanting
HTTPPostMode. This change will be made as a part of the upgrade to use
btcjson2 since it involves an API change.
The addition of the pre-computed values for the ScalarBaseMult
optimizations added a benign race condition since a pointer to each
pre-computed Jacobian point was being used in the call to addJacobian
instead of a local stack copy.
This resulted in the code which normalizes the field values to check for
further optimization conditions such as equal Z values to race against the
IsZero checks when multiple goroutines were performing EC operations since
they were all operating on the same point in memory.
In practice this was benign since the value was being replaced with the
same thing and thus it was the same before and after the race, but it's
never a good idea to have races.
The writeElement function provides faster serialization for primitives.
This commit modifies all instances that call writeElement with a
pointer to a primitive or a byte slice to instead use the primitive /
writeVarBytes function so the faster serialization paths are used.
The benchmarks are still only compiled when running 'go test' so this has
no effect on regular usage. This is being done because benchmarks often
need access to internal state.
Normal tests are kept in a separate package since they also serve to
exercise the public API, and by intentionally making it more difficult to
reach into the internals, it helps ensure the public API is sanely usable.
Since the benchmarks can now access the internals directly, this commit
also removes the functions which exposed the internals to the test package
from internal_test.go which were only used by the benchmarks.