mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-13 20:04:35 +03:00
WIP: scanning notes
This commit is contained in:
parent
f3ae3be90e
commit
6cf2291e23
@ -35,18 +35,17 @@ nixt:walt1
|
||||
```
|
||||
|
||||
## Algos
|
||||
Insert an address
|
||||
1. send wallet an address that we KNOW is in the wallet
|
||||
2. include the address's index
|
||||
|
||||
Scan addresses. (map xpub (pair list list))
|
||||
outgoing wire is /scan/xpub/change/index
|
||||
- keep list of whether we've heard back on an address `(list (unit used))`
|
||||
outgoing wire is /scan/xpub/change/idx
|
||||
- keep (jug cord idx) of xpub+chyg -> idx
|
||||
- every time we get a response
|
||||
- insert the address into the wallet if it's used
|
||||
- check whether (lent (murn l)) == max-gap
|
||||
- if it does, run lien--if any used, continue
|
||||
- if none used, the wallet is scanned.
|
||||
- check whether idx in `scanning`--ignore if not (old response)
|
||||
- insert the address into the wallet **if it's used**
|
||||
- if used, update `has-used` for this xpub to be true
|
||||
- delete idx from `scanning` jug
|
||||
- check whether `scanning` is now empty
|
||||
|
||||
|
||||
|
||||
## scratch code, refactor
|
||||
|
@ -25,6 +25,13 @@
|
||||
+$ wach (map address addi)
|
||||
+$ scon $~([max-index max-index] (pair idx idx))
|
||||
+$ wilt _bip32
|
||||
:: scanning: maps xpub+chyg to set of indices.
|
||||
:: once it's full, we can check whether address in it were blank or not
|
||||
:: seen: holds addresses whose scan results we've seen already
|
||||
::
|
||||
+$ scanning (jug cord idx)
|
||||
+$ has-used (map cord ?)
|
||||
::
|
||||
+$ action
|
||||
$% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @)]
|
||||
[%update-address a=address utxos=(set utxo)]
|
||||
|
Loading…
Reference in New Issue
Block a user