Upstream commit 00ebb9d14d Also, the merge commit contains the necessary decred-specific alterations.
00ebb9d14d