From 78e5593919923551018f89e727670fba23a7e39c Mon Sep 17 00:00:00 2001 From: timlucmiptev Date: Wed, 9 Dec 2020 15:41:05 +0200 Subject: [PATCH] hotfix to watch ALL addresses requested; txinfo records properly --- app/btc-wallet-hook.hoon | 3 +-- app/btc-wallet-store.hoon | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/btc-wallet-hook.hoon b/app/btc-wallet-hook.hoon index 8759fa3c08..badab4ddc2 100644 --- a/app/btc-wallet-hook.hoon +++ b/app/btc-wallet-hook.hoon @@ -335,7 +335,6 @@ :: if no peta (payer/value), just prints address :: %generate-address - :: TODO: find a way to not print the below for a change address ?~ peta.upd ~&(> "wallet-hook: %generate-address: {}" `state) =/ [payer=ship value=sats] u.peta.upd :_ state(ps.piym (~(put by ps.piym) payer [xpub.upd address.upd payer value])) @@ -345,6 +344,7 @@ :: - request provider to create-raw-tx from txbu :: %generate-txbu + :: TODO make tx info fetch correctly :_ state(poym `txbu.upd) ?~ provider ~&(>>> "provider not set" ~) %+ weld ~[(create-raw-tx host.u.provider txbu.upd)] @@ -425,7 +425,6 @@ |= [ri=req-id:bp =txid rt=rawtx] ^- ^poym ?~ poym ~ - ?~ txinfo.u.poym poym ?. =(ri req-id.u.poym) poym `u.poym(txinfo `[txid rt]) :: check poym txbu diff --git a/app/btc-wallet-store.hoon b/app/btc-wallet-store.hoon index 039d544541..86e52d6b9f 100644 --- a/app/btc-wallet-store.hoon +++ b/app/btc-wallet-store.hoon @@ -266,7 +266,8 @@ (bump-batch xpub %1) :- (weld cards0 cards1) state(scans (insert-batches xpub batch0 batch1)) -:: +update-address: watch the address passed; update wallet if it's used +:: +update-address: watch the address passed; +:: - update wallet with the address :: - if address is unused, send %address-info request :: - if address doesn't have enough confs, send %address-info request :: - if this idx was the last in todo.scans, do run-scan to see whether scan is done @@ -279,7 +280,7 @@ state(last-block last-block) =/ w=(unit walt) (~(get by walts) xpub) ?~ w `state - =? walts used + =. walts %+ ~(put by walts) xpub %+ ~(update-address wad u.w chyg) (~(mk-address wad u.w chyg) idx)