Re: How is partially resetting of transaction download supposed to work?

2017-04-28 Thread Leo Wandersleb
The bigger picture is that I am trying to make Mycelium work without 
Mycelium servers and one of the nice features we have, is cold wallet 
spending and account importing. I already keep certain meta-data on the 
mycelium side - and the private keys - and see the spv-module as a pure 
interface to the blockchain. The committed bloom filters is something I 
thought to use to quickly identify which block to download for cold wallet 
spending. UTXO commitments would help of course, too. So I might work on 
those things soon.

For now, thank you for explaining things. Will see how priorities are.

On Friday, 28 April 2017 10:15:16 UTC-3, Andreas Schildbach wrote:
>
> On 04/27/2017 11:09 PM, Leo Wandersleb wrote: 
>
> > So, if I have a wallet with birthday 100 and at time 200 want to add an 
> > address with date 198, I have to load all back from 100? 
>
> Yes. 
>
> > Now if I add an 
> > address with date 90, does the wallet update its "birthday" accordingly 
> > or do I have to also do something beyond the individual address creation 
> > dates? 
>
> The wallet calculates its birthdate automatically. Actually the wallet 
> birthdate isn't a persistent value but simply the minimum of all key and 
> seed birthdates in that wallet. 
>
> > How hard do you think it would be to improve bitcoinJ in that respect? 
>
> I'd say it's doable, but not trivial. Probably safest way to do this is 
> roll back (remove from wallet) transactions in the order latest to 
> oldest. At the same time, the block store would need to be rewound up to 
> the point where it is empty (it's a ring buffer). 
>
> > Do you see interest with others to implement something like that? 
>
> Good question. Replaying the chain (even parts of) should be rare. The 
> problem with removing transactions is also we loose all metadata (data 
> that doesn't come from the blockchain). 
>
> @all: What do others think about this one in particular? 
>
> > Do you see interest to merge it, if I implemented it with tests and all? 
>
> Yes, I think it would be useful. 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is partially resetting of transaction download supposed to work?

2017-04-28 Thread Andreas Schildbach
On 04/27/2017 11:09 PM, Leo Wandersleb wrote:

> So, if I have a wallet with birthday 100 and at time 200 want to add an
> address with date 198, I have to load all back from 100?

Yes.

> Now if I add an
> address with date 90, does the wallet update its "birthday" accordingly
> or do I have to also do something beyond the individual address creation
> dates?

The wallet calculates its birthdate automatically. Actually the wallet
birthdate isn't a persistent value but simply the minimum of all key and
seed birthdates in that wallet.

> How hard do you think it would be to improve bitcoinJ in that respect?

I'd say it's doable, but not trivial. Probably safest way to do this is
roll back (remove from wallet) transactions in the order latest to
oldest. At the same time, the block store would need to be rewound up to
the point where it is empty (it's a ring buffer).

> Do you see interest with others to implement something like that?

Good question. Replaying the chain (even parts of) should be rare. The
problem with removing transactions is also we loose all metadata (data
that doesn't come from the blockchain).

@all: What do others think about this one in particular?

> Do you see interest to merge it, if I implemented it with tests and all?

Yes, I think it would be useful.


-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How is partially resetting of transaction download supposed to work?

2017-04-27 Thread Andreas Schildbach
Partial reset has never been implemented. Currently you always need to
sync from the wallet birthdate.


On 04/26/2017 10:32 PM, Leo Wandersleb wrote:
> Hi,
> 
> occasionally my app needs to add addresses with past, non-zero creation
> times.
> 
> I figured, iterating through the block headers until creation-time - 4h
> and feeding that block height to |public void clearTransactions(int
> fromHeight)| should trigger the resync but throws an error
> 
> in a way that I would at least expect a comment or TODO on that line.
> Is there another way to achieve what I want to achieve?
> 
> Regards,
> 
> Leo Wandersleb
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bitcoinj+unsubscr...@googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bitcoinj+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.