         self.feePerKb = feePerKb
 
         if UserDefaults.isTouchIdEnabled && walletManager.canUseTouchID(forTx:tx) {
-            walletManager.signTransaction(tx, touchIDPrompt: touchIdMessage, completion: { result in
-                if result == .success {
-                    self.publish(completion: completion)
-                } else {
-                    if result == .failure || result == .fallback {
-                        self.verifyPin(tx: tx, withFunction: verifyPinFunction, completion: completion)
+            DispatchQueue.walletQueue.async { [weak self] in
+                guard let myself = self else { return }
+                myself.walletManager.signTransaction(tx, touchIDPrompt: touchIdMessage, completion: { result in
+                    if result == .success {
+                        myself.publish(completion: completion)
+                    } else {
+                        if result == .failure || result == .fallback {
+                            myself.verifyPin(tx: tx, withFunction: verifyPinFunction, completion: completion)
+                        }
                     }
-                }
-            })
+                })
+            }
         } else {
             self.verifyPin(tx: tx, withFunction: verifyPinFunction, completion: completion)
         }


    private func verifyPin(tx: BRTxRef, withFunction: (@escaping(String) -> Bool) -> Void, completion:@escaping (SendResult) -> Void) {
        withFunction({ pin in
            if self.walletManager.signTransaction(tx, pin: pin) {
                self.publish(completion: completion)
                return true
            } else {
                return false
            }
        })
    }

    private func publish(completion: @escaping (SendResult) -> Void) {
        guard let tx = transaction else { return }
        walletManager.peerManager?.publishTx(tx, completion: { [weak self] success, error in
            DispatchQueue.main.async {
                if let error = error {
                    completion(.publishFailure(error))
                } else {
                    self?.setMetaData()
                    completion(.success)
                    self?.postProtocolPaymentIfNeeded()
                }
            }
        })
    }

    private func setMetaData() {

//

import Foundation
import UIKit
import BRCore

enum SendResult {
