From 9bd6431b8163344d240af07269b5bd329578bf8c Mon Sep 17 00:00:00 2001 From: timlucmiptev Date: Sat, 31 Oct 2020 19:26:58 +0200 Subject: [PATCH] scanning types compile --- app/btc-wallet-store.hoon | 7 +++---- sur/btc-wallet-store.hoon | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/btc-wallet-store.hoon b/app/btc-wallet-store.hoon index 46099f9fc..d2702c9b0 100644 --- a/app/btc-wallet-store.hoon +++ b/app/btc-wallet-store.hoon @@ -17,9 +17,8 @@ :: +$ state-0 $: %0 - walts=(map xpub:btc walt) - =scanning - =has-used + walts=(map xpub:btc _walt) + =scans == :: +$ card card:agent:gall @@ -38,7 +37,7 @@ ++ on-init ^- (quip card _this) ~& > '%btc-wallet-store initialized' - `this(state [%0 *(map tape walt) max-gap=20]) + `this(state [%0 *(map xpub:btc _walt) *^scans]) ++ on-save ^- vase !>(state) diff --git a/sur/btc-wallet-store.hoon b/sur/btc-wallet-store.hoon index 8455a1f2e..efe879002 100644 --- a/sur/btc-wallet-store.hoon +++ b/sur/btc-wallet-store.hoon @@ -25,17 +25,18 @@ +$ 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 +:: todo: Set of indices; empty it out until none are left--means scanning of that batch is done +:: has-used: whether current batch had any addresses with activity +:: last: index that wallet has been scanned to prior to this batch :: -+$ scanning (jug cord idx) -+$ has-used (map cord ?) ++$ waltscan [todo=(set idx) has-used=? last=idx] ++$ scans (map [xpub chyg] waltscan) :: +$ action $% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @)] [%update-address a=address utxos=(set utxo)] == +:: +$ update $% [%address a=address utxos=(set utxo)] ==