-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client/asset: custom address stringer
The exchange wallets had an address decoder function for converting a string to a btcutil.Address, which is required for assets like BCH with special address formats. However, it is incorrect to then use the btcutil.Address String method go get a human readable address. This adds a complementary helper function for converting from a btcutil.Address to a correct string. Normally this is simply using the Address as a Stringer, but for BCH it is the new EncodeCashAddress function, which powers the existing RecodeCashAddress. This updates the btc baseWallet methods to use the new stringAddr to achieve the reverse of decodeAddr. This ensures that the string address stored in the fundingCoins is correct for the asset. This also ensures the recipient address in AuditContract is correct. I believe the main issue resolved by this is providing the correct address to the node.privKeyForAddress method when signing. This also provides the correct string to the getaddressinfo RPC. It is not clear if bitcoincashd was previously ok with the incorrect address strings when handling RPCs. This also removes the unused (*auditInfo).Recipient method, and fixes the documentation for the other methods since there is no longer an asset.AuditInfo *interface*, just a struct.
- Loading branch information
Showing
7 changed files
with
88 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters