Added support for coins with 2 address prefix bytes. Address derivation still needs more work for Pirate Chain (Zcash address format)
This commit is contained in:
parent
cc0cfcc7d1
commit
ffa19210e0
@ -687,8 +687,14 @@ export default class AltcoinHDWallet {
|
|||||||
* Derive Litecoin Legacy Address
|
* Derive Litecoin Legacy Address
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Append Address Prefix
|
// Append Address Prefix
|
||||||
const k = [this.versionBytes.mainnet.prefix].concat(...this.grandChildPublicKeyHash)
|
let prefix = [this.versionBytes.mainnet.prefix]
|
||||||
|
if (2 == this.versionBytes.mainnet.prefix.length) {
|
||||||
|
prefix = [this.versionBytes.mainnet.prefix[0]]
|
||||||
|
prefix.push([this.versionBytes.mainnet.prefix[1]])
|
||||||
|
}
|
||||||
|
|
||||||
|
const k = prefix.concat(...this.grandChildPublicKeyHash)
|
||||||
|
|
||||||
// Derive Checksum
|
// Derive Checksum
|
||||||
const _addressCheckSum = new Sha256().process(new Sha256().process(new Uint8Array(k)).finish().result).finish().result
|
const _addressCheckSum = new Sha256().process(new Sha256().process(new Uint8Array(k)).finish().result).finish().result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user