Parameter describes whether the containing block is on the main/best chain or whether it's on a presently We still have to know about that to avoid accidentally trying toĪ transaction may be received multiple times if is included into blocks in parallel chains. Network and thus made it into a block, or because our keys are being shared between multiple instances and When a transaction is received thatĬonsumes outputs they are marked as spent so they won't be used in future.Ī transaction that spends our own coins can be received either because a spend we created was accepted by the When a transaction is received that sends usĬoins it is added to a pool so we can use it later to create spends. This is necessary for the internal book-keeping Wallet does. shutdownAutosaveAndWait public void shutdownAutosaveAndWait()Ĭalled by the BlockChain when we receive a new filtered block that contains a transactions previously.eventListener - callback to be informed when the auto-save thread does things, or null timeUnit - the unit of measurement for delayTime. delayTime - How many time units to wait until saving the wallet on a background thread. Parameters: f - The destination file to save to. If delay is zero or you do something that always triggersĪn immediate save, like adding a key, the event listener will be invoked on the calling threads. With the wallet locked when an auto-save occurs. If a delay >0 was specified, it will be called on a background thread You should still save the wallet manually when your program is about to shut down as the JVMĪn event listener can be provided. Note that when a new key is added, that always results in an immediate save regardless ofĭelayTime. It's a good idea to set this as otherwise the wallet can change veryįrequently, eg if there are a lot of transactions in it or during block sync, and there will be a lot of redundant If no changes have occurred for the given time period, nothing will be written. If delayTime is set, a background thread will be created and the wallet will only be saved toĭisk every so many time units. Protocol buffer serialization will be used. After connecting to a file, you no longer need to save the wallet manually, it will do it Sets up the wallet to auto-save itself to the given file, using temp files with atomic renames to ensureĬonsistency. SeeĪutosaveToFile(java.io.File, long,, .WalletFiles.Listener)įor more information about this. The wallet is changing very fast (eg due to a block chain sync). To quit because the auto-save feature waits a moment before actually committing to disk to avoid IO thrashing when That simplifies this for you although you're still responsible for manually triggering a save when your app is about You need to save the wallet whenever it changes, there is an auto-save feature Wallets can be serialized using either Java serialization - this is not compatible across versions of bitcoinj, On the website to learn more about how to set everything up. Other objects, see the Getting started tutorial To fill up a Wallet with transactions, you need to use it in combination with a BlockChain and various It is able to create new transactions that spend the recorded transactions, and this is the fundamental operation A Wallet stores keys and a record of transactions that send and receive value from those keys.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |