This updates the minimum relay fee in the sample config file to match
the actual default. Note that it's commented anyways, so this does not
result in any logical change. However, the file aims to have the
defaults commented out by default, so it makes sense to update the
value accordingly.
This adds a directive to instruct gometalinter to ignore a false
positive produced by vet. The code in question intentionally makes use
of the property vet is warning about.
This modifies the recently-added NullDataScript function in several
ways in an effort to make them more consistent with the tests in the
rest of the code base and improve/correct the logic:
- Use the hexToBytes and mustParseShortForm functions
- Consistently format the test errors
- Replace the valid bool flag with an expected error and test against it
- Ensure the returned script type is the expected type in all cases
This modifies the exported CalcSignatureHash function to accept a script
as bytes instead of an array of parsed opcodes which are not available
to callers outside of the package.
While here, it also adds a proper comment for the exported function
since it is intended for more than testing as the previous comment
claimed.
Finally, it updates the tests to use a valid script instead of the
previous impossible to achieve constructed series of parsed opcodes.
This adds a new package under dcrutil named txsort which implements a
standard lexicographical sort order of transaction inputs and outputs.
This is useful to standardize transactions for faster multi-party
agreement as well as preventing information leaks in a single-party use
case. It is a modified form of BIP69 which has been updated to account
for differences with Decred-specific transactions.
The sort order for transaction inputs is defined as follows:
- Previous transaction tree in ascending order
- Previous transaction hash (treated as a big-endian uint256)
lexicographically in ascending order
- Previous output index in ascending order
The sort order for transaction outputs is defined as follows:
- Amount in ascending order
- Public key script version in ascending order
- Raw public key script bytes lexicographically in ascending order
go1.10 fixes a bug in encoding/json that allowed it to allocate an unexported field, but (*rpcclient.Client).handleMessage relied on this behavior to unmarshal into inMessage. Address the go1.10 fix by allocating the unexported pointer types (rawResponse and rawNotification).
This modifies the rpctest framework to start btcd with the appropriate
network flags depending on the provided parameters.
Previously, it always started btcd with --simnet even if other
parameters, such as those for the regression test network, were
provided.
All instances of data race are related to accessing
KnownAddress elements, except for peer.go where its
related to closure.
Following are the changes:
- Add KnownAddress.mtx (sync.Mutex) and used same to
sync access points
- For peer.go, pass local copy to the closure