Skip to content

Commit e7e053f

Browse files
committed
ensure wallet has address of mweb output in local db
1 parent 219b4d1 commit e7e053f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/wallets/wallet/wallet_mixin_interfaces/mweb_interface.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ mixin MwebInterface<T extends ElectrumXCurrencyInterface>
229229
await db.into(db.mwebUtxos).insertOnConflictUpdate(newUtxo);
230230
});
231231

232+
Address? addr = await mainDB.getAddress(walletId, utxo.address);
233+
while (addr == null || addr.value != utxo.address) {
234+
addr = await generateNextMwebAddress();
235+
await mainDB.updateOrPutAddresses([addr]);
236+
}
237+
232238
// TODO get real txid one day
233239
final fakeTxid = "mweb_outputId_${utxo.outputId}";
234240

0 commit comments

Comments
 (0)