package Ġio . horizontal systems . dash kit Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . database . sqlite . SQLite Database Ċ import Ġio . horizontal systems . bitcoin core . Abstract Kit Ċ import Ġio . horizontal systems . bitcoin core . Bitcoin Core Ċ import Ġio . horizontal systems . bitcoin core . Bitcoin Core . Sync Mode Ċ import Ġio . horizontal systems . bitcoin core . Bitcoin Core Builder Ċ import Ġio . horizontal systems . bitcoin core . blocks . validators . Block Validator Chain Ċ import Ġio . horizontal systems . bitcoin core . blocks . validators . Block Validator Set Ċ import Ġio . horizontal systems . bitcoin core . blocks . validators . Proof OfWork Validator Ċ import Ġio . horizontal systems . bitcoin core . extensions . hex To ByteArray Ċ import Ġio . horizontal systems . bitcoin core . managers .* Ċ import Ġio . horizontal systems . bitcoin core . models . Balance Info Ċ import Ġio . horizontal systems . bitcoin core . models . Block Info Ċ import Ġio . horizontal systems . bitcoin core . models . Transaction Filter Type Ċ import Ġio . horizontal systems . bitcoin core . models . Transaction Info Ċ import Ġio . horizontal systems . bitcoin core . network . Network Ċ import Ġio . horizontal systems . bitcoin core . storage . Core Database Ċ import Ġio . horizontal systems . bitcoin core . storage . Storage Ċ import Ġio . horizontal systems . bitcoin core . transactions . Transaction Size Calculator Ċ import Ġio . horizontal systems . bitcoin core . utils . Base 5 8 Address Converter Ċ import Ġio . horizontal systems . bitcoin core . utils . Mer kle Branch Ċ import Ġio . horizontal systems . bitcoin core . utils . Payment Address Parser Ċ import Ġio . horizontal systems . dash kit . core . Dash Transaction Info Converter Ċ import Ġio . horizontal systems . dash kit . core . Single Sha 2 5 6 Hash er Ċ import Ġio . horizontal systems . dash kit . inst ants end .* Ċ import Ġio . horizontal systems . dash kit . inst ants end . inst ants end lock . Instant Send Lock Handler Ċ import Ġio . horizontal systems . dash kit . inst ants end . inst ants end lock . Instant Send Lock Manager Ċ import Ġio . horizontal systems . dash kit . inst ants end . transaction lock vote . Transaction Lock Vote Handler Ċ import Ġio . horizontal systems . dash kit . inst ants end . transaction lock vote . Transaction Lock Vote Manager Ċ import Ġio . horizontal systems . dash kit . managers .* Ċ import Ġio . horizontal systems . dash kit . master node list .* Ċ import Ġio . horizontal systems . dash kit . messages .* Ċ import Ġio . horizontal systems . dash kit . models . Coin base Transaction Serializer Ċ import Ġio . horizontal systems . dash kit . models . Dash Transaction Info Ċ import Ġio . horizontal systems . dash kit . models . Instant Transaction State Ċ import Ġio . horizontal systems . dash kit . storage . Dash Kit Database Ċ import Ġio . horizontal systems . dash kit . storage . Dash Storage Ċ import Ġio . horizontal systems . dash kit . tasks . Peer Task Factory Ċ import Ġio . horizontal systems . dash kit . validators . Dark Gravity Wave Test net Validator Ċ import Ġio . horizontal systems . dash kit . validators . Dark Gravity Wave Validator Ċ import Ġio . horizontal systems . hd wallet kit . Mnemonic Ċ import Ġio . reactivex . rx java 3 . core . Single Ċ Ċ class ĠDash Kit Ġ: ĠAbstract Kit , ĠI Instant Transaction Delegate , ĠBitcoin Core . Listener Ġ{ ĊĠĠĠ Ġenum Ġclass ĠNetwork Type Ġ{ ĊĠĠĠĠĠĠĠ ĠMain Net , ĊĠĠĠĠĠĠĠ ĠTest Net ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinterface ĠListener Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġon Transactions Update ( inserted : ĠList < Dash Transaction Info >, Ġupdated : ĠList < Dash Transaction Info >) ĊĠĠĠĠĠĠĠ Ġfun Ġon Transactions Delete ( hashes : ĠList < String >) ĊĠĠĠĠĠĠĠ Ġfun Ġon Balance Update ( balance : ĠBalance Info ) ĊĠĠĠĠĠĠĠ Ġfun Ġon Last Block Info Update ( block Info : ĠBlock Info ) ĊĠĠĠĠĠĠĠ Ġfun Ġon Kit State Update ( state : ĠBitcoin Core . Kit State ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġvar Ġlistener : ĠListener ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġvar Ġbitcoin Core : ĠBitcoin Core ĊĠĠĠ Ġoverride Ġvar Ġnetwork : ĠNetwork ĊĊĠĠĠ Ġprivate Ġval Ġdash Storage : ĠDash Storage ĊĠĠĠ Ġprivate Ġval Ġinstant Send : ĠInstant Send ĊĠĠĠ Ġprivate Ġval Ġdash Transaction Info Converter : ĠDash Transaction Info Converter ĊĊĠĠĠ Ġconstructor ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext : ĠContext , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwords : ĠList < String >, ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpassphrase : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnetwork Type : ĠNetwork Type Ġ= ĠNetwork Type . Main Net , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Size : ĠInt Ġ= Ġ 1 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsync Mode : ĠSync Mode Ġ= ĠSync Mode . Api (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm ations Threshold : ĠInt Ġ= Ġ 6 ĊĠĠĠ Ġ) Ġ: Ġthis ( context , ĠM n emonic (). to Seed ( words , Ġpassphrase ), Ġwallet Id , Ġnetwork Type , Ġpeer Size , Ġsync Mode , Ġconfirm ations Threshold ) ĊĊĠĠĠ Ġconstructor ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext : ĠContext , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġseed : ĠByteArray , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwallet Id : ĠString , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnetwork Type : ĠNetwork Type Ġ= ĠNetwork Type . Main Net , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġpeer Size : ĠInt Ġ= Ġ 1 0 , ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsync Mode : ĠSync Mode Ġ= ĠSync Mode . Api (), ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm ations Threshold : ĠInt Ġ= Ġ 6 ĊĠĠĠ Ġ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcore Database Ġ= ĠCore Database . getInstance ( context , Ġget Database Name Core ( network Type , Ġwallet Id , Ġsync Mode )) ĊĠĠĠĠĠĠĠ Ġval Ġdash Database Ġ= ĠDash Kit Database . getInstance ( context , Ġget Database Name ( network Type , Ġwallet Id , Ġsync Mode )) ĊĠĠĠĠĠĠĠ Ġval Ġinitial Sync Url : ĠString ĊĊĠĠĠĠĠĠĠ Ġval Ġcore Storage Ġ= ĠStorage ( core Database ) ĊĠĠĠĠĠĠĠ Ġdash Storage Ġ= ĠDash Storage ( dash Database , Ġcore Storage ) ĊĊĠĠĠĠĠĠĠ Ġnetwork Ġ= Ġwhen Ġ( network Type ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNetwork Type . Main Net Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinitial Sync Url Ġ= Ġ" https :// dash . horizontal systems . xyz / ap g " ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠMain Net Dash () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNetwork Type . Test Net Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġinitial Sync Url Ġ= Ġ" http :// dash - test net . horizontal systems . xyz / ap g " ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠTest Net Dash () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġval Ġpayment Address Parser Ġ= ĠPayment Address Parser (" dash ", Ġremove Scheme Ġ= Ġtrue ) ĊĠĠĠĠĠĠĠ Ġval Ġinstant Transaction Manager Ġ= ĠInstant Transaction Manager ( dash Storage , ĠInstant Send Factory (), ĠInstant Transaction State ()) ĊĠĠĠĠĠĠĠ Ġval Ġinitial Sync Api Ġ= ĠIns ight Api ( initial Sync Url ) ĊĊĠĠĠĠĠĠĠ Ġdash Transaction Info Converter Ġ= ĠDash Transaction Info Converter ( instant Transaction Manager ) ĊĊĠĠĠĠĠĠĠ Ġval Ġblock Helper Ġ= ĠBlock Validator Helper ( core Storage ) ĊĊĠĠĠĠĠĠĠ Ġval Ġblock Validator Set Ġ= ĠBlock Validator Set () ĊĠĠĠĠĠĠĠ Ġblock Validator Set . add Block Validator ( Proof OfWork Validator ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġblock Validator Chain Ġ= ĠBlock Validator Chain () ĊĊĠĠĠĠĠĠĠ Ġif Ġ( network Ġis ĠMain Net Dash ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Validator Chain . add ( Dark Gravity Wave Validator ( block Helper , Ġheight Interval , Ġtarget Time span , Ġmax Target Bits , Ġ 6 8 5 8 9 )) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Validator Chain . add ( Dark Gravity Wave Test net Validator ( target Spacing , Ġtarget Time span , Ġmax Target Bits , Ġ 4 0 0 2 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblock Validator Chain . add ( Dark Gravity Wave Validator ( block Helper , Ġheight Interval , Ġtarget Time span , Ġmax Target Bits , Ġ 4 0 0 2 )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġblock Validator Set . add Block Validator ( block Validator Chain ) ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core Ġ= ĠBitcoin Core Builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Context ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Seed ( seed ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Network ( network ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Payment Address Parser ( payment Address Parser ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Peer Size ( peer Size ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Sync Mode ( sync Mode ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Confirmation Threshold ( confirm ations Threshold ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Storage ( core Storage ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Block Header Hash er ( X 1 1 Hash er ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. setInitial Sync Api ( initial Sync Api ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Transaction Info Converter ( dash Transaction Info Converter ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Block Validator ( block Validator Set ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . listener Ġ= Ġthis ĊĊĠĠĠĠĠĠĠ Ġ// Ġ Ġextending Ġbitcoin Core ĊĊĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . addMessage Parser ( Master node List Diff Message Parser ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addMessage Parser ( Transaction Lock Message Parser ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addMessage Parser ( Transaction Lock Vote Message Parser ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. addMessage Parser ( IS Lock Message Parser ()) ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . addMessage Serializer ( Get Master node List Diff Message Serializer ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġmer kle Root Hash er Ġ= ĠMer kle Root Hash er () ĊĠĠĠĠĠĠĠ Ġval Ġmer kle Root Creator Ġ= ĠMer kle Root Creator ( mer kle Root Hash er ) ĊĠĠĠĠĠĠĠ Ġval Ġmaster node List Mer kle Root Calculator Ġ= ĠMaster node List Mer kle Root Calculator ( mer kle Root Creator ) ĊĠĠĠĠĠĠĠ Ġval Ġmaster node Cb Tx Hash er Ġ= ĠMaster node Cb Tx Hash er ( Coin base Transaction Serializer (), Ġmer kle Root Hash er ) ĊĊĠĠĠĠĠĠĠ Ġval Ġqu orum List Manager Ġ= ĠQu orum List Manager ( dash Storage , ĠQu orum List Mer kle Root Calculator ( mer kle Root Creator ), ĠQu orum Sort edList ()) ĊĠĠĠĠĠĠĠ Ġval Ġmaster node List Manager Ġ= ĠMaster node List Manager ( dash Storage , Ġmaster node List Mer kle Root Calculator , Ġmaster node Cb Tx Hash er , ĠMer kle Branch (), ĠMaster node Sort edList (), Ġqu orum List Manager ) ĊĠĠĠĠĠĠĠ Ġval Ġmaster node Sync er Ġ= ĠMaster node List Sync er ( bitcoin Core , ĠPeer Task Factory (), Ġmaster node List Manager , Ġbitcoin Core . initial Block Download ) ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Peer Task Handler ( master node Sync er ) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Peer Sync Listener ( master node Sync er ) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Peer Group Listener ( master node Sync er ) ĊĊĠĠĠĠĠĠĠ Ġval Ġbase 5 8 Address Converter Ġ= ĠBase 5 8 Address Converter ( network . address Version , Ġnetwork . address Script Version ) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Restore Key Converter ( B ip 4 4 Restore Key Converter ( base 5 8 Address Converter )) ĊĊĠĠĠĠĠĠĠ Ġval Ġsingle Hash er Ġ= ĠSingle Sha 2 5 6 Hash er () ĊĠĠĠĠĠĠĠ Ġval Ġbl s Ġ= ĠB LS () ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Lock Vote Validator Ġ= ĠTransaction Lock Vote Validator ( dash Storage , Ġsingle Hash er , Ġbl s ) ĊĠĠĠĠĠĠĠ Ġval Ġinstant Send Lock Validator Ġ= ĠInstant Send Lock Validator ( qu orum List Manager , Ġbl s ) ĊĊĠĠĠĠĠĠĠ Ġval Ġtransaction Lock Vote Manager Ġ= ĠTransaction Lock Vote Manager ( transaction Lock Vote Validator ) ĊĠĠĠĠĠĠĠ Ġval Ġinstant Send Lock Manager Ġ= ĠInstant Send Lock Manager ( instant Send Lock Validator ) ĊĊĠĠĠĠĠĠĠ Ġval Ġinstant Send Lock Handler Ġ= ĠInstant Send Lock Handler ( instant Transaction Manager , Ġinstant Send Lock Manager ) ĊĠĠĠĠĠĠĠ Ġinstant Send Lock Handler . delegate Ġ= Ġthis ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Lock Vote Handler Ġ= ĠTransaction Lock Vote Handler ( instant Transaction Manager , Ġtransaction Lock Vote Manager ) ĊĠĠĠĠĠĠĠ Ġtransaction Lock Vote Handler . delegate Ġ= Ġthis ĊĊĠĠĠĠĠĠĠ Ġval Ġinstant Send Ġ= ĠInstant Send ( bitcoin Core . transaction Sync er , Ġtransaction Lock Vote Handler , Ġinstant Send Lock Handler ) ĊĠĠĠĠĠĠĠ Ġthis . instant Send Ġ= Ġinstant Send ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Inventory Items Handler ( instant Send ) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . add Peer Task Handler ( instant Send ) ĊĊĠĠĠĠĠĠĠ Ġval Ġcalculator Ġ= ĠTransaction Size Calculator () ĊĠĠĠĠĠĠĠ Ġval Ġconfirmed Un spent Output Provider Ġ= ĠConf irmed Un spent Output Provider ( core Storage , Ġconfirm ations Threshold ) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . prepend Un spent Output Selector ( Un spent Output Selector ( calculator , Ġconfirmed Un spent Output Provider )) ĊĠĠĠĠĠĠĠ Ġbitcoin Core . prepend Un spent Output Selector ( Un spent Output Selector Single No Change ( calculator , Ġconfirmed Un spent Output Provider )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġdash Transactions ( from Uid : ĠString ? Ġ= Ġnull , Ġtype : ĠTransaction Filter Type ? Ġ= Ġnull , Ġlimit : ĠInt ? Ġ= Ġnull ): ĠSingle < List < Dash Transaction Info >> Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtransactions ( from Uid , Ġtype , Ġlimit ). map Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit . map NotNull Ġ{ Ġit Ġas ? ĠDash Transaction Info Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Dash Transaction ( hash : ĠString ): ĠDash Transaction Info ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġget Transaction ( hash ) Ġas ? ĠDash Transaction Info ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠBitcoin Core . Listener ĊĠĠĠ Ġoverride Ġfun Ġon Transactions Update ( inserted : ĠList < Transaction Info >, Ġupdated : ĠList < Transaction Info >) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// Ġcheck Ġfor Ġall Ġnew Ġtransactions Ġif Ġit 's Ġhas Ġinstant Ġlock ĊĠĠĠĠĠĠĠ Ġinserted . map Ġ{ Ġit . transaction Hash . hex To ByteArray (). reversed Array () Ġ}. forEach Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinstant Send . handle ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġlistener ?. on Transactions Update ( inserted . map NotNull Ġ{ Ġit Ġas ? ĠDash Transaction Info Ġ}, Ġupdated . map NotNull Ġ{ Ġit Ġas ? ĠDash Transaction Info Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Transactions Delete ( hashes : ĠList < String >) Ġ{ ĊĠĠĠĠĠĠĠ Ġlistener ?. on Transactions Delete ( hashes ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Balance Update ( balance : ĠBalance Info ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlistener ?. on Balance Update ( balance ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Last Block Info Update ( block Info : ĠBlock Info ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlistener ?. on Last Block Info Update ( block Info ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Kit State Update ( state : ĠBitcoin Core . Kit State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlistener ?. on Kit State Update ( state ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠI Instant Transaction Delegate ĊĠĠĠ Ġoverride Ġfun ĠonUpdate Instant ( transaction Hash : ĠByteArray ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Ġ= Ġdash Storage . getFull Transaction Info ( transaction Hash ) Ġ?: Ġreturn ĊĠĠĠĠĠĠĠ Ġval Ġtransaction Info Ġ= Ġdash Transaction Info Converter . transaction Info ( transaction ) ĊĊĠĠĠĠĠĠĠ Ġbitcoin Core . listener Executor . execute Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlistener ?. on Transactions Update ( listOf (), ĠlistOf ( transaction Info )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġmax Target Bits : ĠLong Ġ= Ġ 0 x 1 e 0 fffff ĊĊĠĠĠĠĠĠĠ Ġconst Ġval Ġtarget Spacing Ġ= Ġ 1 5 0 ĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġ 2 . 5 Ġmin . Ġfor Ġmining Ġ 1 ĠBlock ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġtarget Time span Ġ= Ġ 3 6 0 0 L ĠĠĠĠĠĠĠĠĠ Ġ// Ġ 1 Ġhour Ġfor Ġ 2 4 Ġblocks ĊĠĠĠĠĠĠĠ Ġconst Ġval Ġheight Interval Ġ= Ġtarget Time span Ġ/ Ġtarget Spacing ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġget Database Name Core ( network Type : ĠNetwork Type , Ġwallet Id : ĠString , Ġsync Mode : ĠSync Mode ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ"${ get Database Name ( network Type , Ġwallet Id , Ġsync Mode )} - core " ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġget Database Name ( network Type : ĠNetwork Type , Ġwallet Id : ĠString , Ġsync Mode : ĠSync Mode ) Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" Dash -${ network Type . name }- $ wallet Id -${ sync Mode . java Class . simple Name }" ĊĊĠĠĠĠĠĠĠ Ġfun Ġclear ( context : ĠContext , Ġnetwork Type : ĠNetwork Type , Ġwallet Id : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfor Ġ( sync Mode Ġin ĠlistOf ( Sync Mode . Api (), ĠSync Mode . Full (), ĠSync Mode . New Wallet ())) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSQLite Database . delete Database ( context . get Database Path ( get Database Name Core ( network Type , Ġwallet Id , Ġsync Mode ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠSQLite Database . delete Database ( context . get Database Path ( get Database Name ( network Type , Ġwallet Id , Ġsync Mode ))) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( ex : ĠException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcontinue ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ } Ċ