lnwallet+lnrpc: add address index to ListAddresses
For the itest in the next commit we'll need to be able to fetch the input information for an address over RPC. The only piece missing is the address' index, which we add in this commit. Everything else should be derivable from the ListAddresses and ListAccounts calls.
This commit is contained in:
6 files changed
+663
-593
No files matched your search
@@ -2054,10 +2054,16 @@ func marshalWalletAddressList(w *WalletKit, account *waddrmgr.AccountProperties,
|
||||
|
||||
addresses := make([]*AddressProperty, len(addressList))
|
||||
for idx, addr := range addressList {
|
||||
var pubKeyBytes []byte
|
||||
if addr.PublicKey != nil {
|
||||
pubKeyBytes = addr.PublicKey.SerializeCompressed()
|
||||
}
|
||||
addresses[idx] = &AddressProperty{
|
||||
Address: addr.Address,
|
||||
IsInternal: addr.Internal,
|
||||
Balance: int64(addr.Balance),
|
||||
Address: addr.Address,
|
||||
IsInternal: addr.Internal,
|
||||
Balance: int64(addr.Balance),
|
||||
DerivationPath: addr.DerivationPath,
|
||||
PublicKey: pubKeyBytes,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user