Skip to content

Commit d902e68

Browse files
committed
feat: apply unconfirmed
1 parent 098a96f commit d902e68

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

BDKSwiftExampleWallet/Service/BDK Service/BDKService.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,16 @@ private class BDKService {
557557
if isSigned {
558558
let transaction = try psbt.extractTx()
559559
try self.blockchainClient.broadcast(transaction)
560+
561+
if self.clientType == .kyoto {
562+
let lastSeen = UInt64(Date().timeIntervalSince1970)
563+
let unconfirmedTx = UnconfirmedTx(tx: transaction, lastSeen: lastSeen)
564+
wallet.applyUnconfirmedTxs(unconfirmedTxs: [unconfirmedTx])
565+
guard let persister = self.persister else {
566+
throw WalletError.dbNotFound
567+
}
568+
let _ = try wallet.persist(persister: persister)
569+
}
560570
} else {
561571
throw WalletError.notSigned
562572
}

0 commit comments

Comments
 (0)