@@ -8,8 +8,7 @@ import java.nio.file.Files
8
8
import java.nio.file.Paths
9
9
import org.slf4j.Logger
10
10
import org.slf4j.LoggerFactory
11
-
12
-
11
+ import java.nio.file.Path
13
12
14
13
fun main () {
15
14
// Regtest environment must have Compact block filter enabled to run this
@@ -19,9 +18,10 @@ fun main() {
19
18
val ip: IpAddress = IpAddress .fromIpv4(127u , 0u , 0u , 1u )
20
19
val peer: Peer = Peer (ip, 18444u , false )
21
20
val peers: List <Peer > = listOf (peer)
22
- val currentPath = Paths .get(" examples/data" ).toAbsolutePath().normalize()
23
- println (" Current path: $currentPath " )
24
- val persistenceFilePath = Files .createTempDirectory(currentPath, " kyoto-data_" )
21
+
22
+ val persistenceDir: Path = Paths .get(" examples/data" ).toAbsolutePath().normalize()
23
+ Files .createDirectories(persistenceDir)
24
+ val persistenceFilePath: Path = Files .createTempDirectory(persistenceDir, " kyoto-data_" )
25
25
26
26
val wallet = getNewWallet(ActiveWalletScriptType .P2WPKH , Network .REGTEST )
27
27
val address = wallet.revealNextAddress(KeychainKind .EXTERNAL )
@@ -39,7 +39,7 @@ fun main() {
39
39
val lightClient = CbfBuilder ()
40
40
.peers(peers)
41
41
.connections(1u )
42
- .scanType(ScanType .New )
42
+ .scanType(ScanType .Sync )
43
43
.dataDir(persistenceFilePath.toString())
44
44
.build(wallet)
45
45
val client = lightClient.client
0 commit comments