From b1c8b313f9da3b6ab182fc66eba136a98481147d Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Tue, 30 Jun 2020 12:06:49 -0300 Subject: [PATCH] add index to address model --- bip44/hd.go | 2 ++ bip44/models.go | 1 + 2 files changed, 3 insertions(+) diff --git a/bip44/hd.go b/bip44/hd.go index e9a4df0..4abf917 100755 --- a/bip44/hd.go +++ b/bip44/hd.go @@ -98,6 +98,7 @@ func bip44(coin *Altcoin, start, qty int, pkb []byte) (*Account, error) { Address: address.String(), Pubkey: "0x" + hex.EncodeToString(pubk.SerializeCompressed()), Privkey: "0x" + hex.EncodeToString(privk.Serialize()), + Index: i, }) continue @@ -125,6 +126,7 @@ func bip44(coin *Altcoin, start, qty int, pkb []byte) (*Account, error) { Address: address.String(), Pubkey: hex.EncodeToString(pubk.SerializeCompressed()), Privkey: wif.String(), + Index: i, }) } return account, nil diff --git a/bip44/models.go b/bip44/models.go index 42af889..a4ef9ad 100755 --- a/bip44/models.go +++ b/bip44/models.go @@ -11,6 +11,7 @@ type Address struct { Address string Pubkey string Privkey string + Index int } type Account struct {