mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-25 11:45:59 +00:00
fix address generation index bug
This commit is contained in:
parent
bfc71dee67
commit
7ddf212091
1 changed files with 2 additions and 2 deletions
|
@ -27,7 +27,7 @@ abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
||||||
@override
|
@override
|
||||||
Future<void> generateNewReceivingAddress() async {
|
Future<void> generateNewReceivingAddress() async {
|
||||||
final current = await getCurrentReceivingAddress();
|
final current = await getCurrentReceivingAddress();
|
||||||
final index = current?.derivationIndex ?? 0;
|
final index = current == null ? 0 : current.derivationIndex + 1;
|
||||||
const chain = 0; // receiving address
|
const chain = 0; // receiving address
|
||||||
|
|
||||||
final address = await _generateAddress(
|
final address = await _generateAddress(
|
||||||
|
@ -49,7 +49,7 @@ abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
||||||
@override
|
@override
|
||||||
Future<void> generateNewChangeAddress() async {
|
Future<void> generateNewChangeAddress() async {
|
||||||
final current = await getCurrentChangeAddress();
|
final current = await getCurrentChangeAddress();
|
||||||
final index = current?.derivationIndex ?? 0;
|
final index = current == null ? 0 : current.derivationIndex + 1;
|
||||||
const chain = 1; // change address
|
const chain = 1; // change address
|
||||||
|
|
||||||
final address = await _generateAddress(
|
final address = await _generateAddress(
|
||||||
|
|
Loading…
Reference in a new issue