diff --git a/pilot.go b/pilot.go
index <HASH>..<HASH> 100644
--- a/pilot.go
+++ b/pilot.go
@@ -183,7 +183,7 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error) 
 
 	// We'll launch a goroutine to provide the agent with notifications
 	// whenever the balance of the wallet changes.
-	svr.wg.Add(1)
+	svr.wg.Add(2)
 	go func() {
 		defer txnSubscription.Cancel()
 		defer svr.wg.Done()
@@ -199,7 +199,6 @@ func initAutoPilot(svr *server, cfg *autoPilotConfig) (*autopilot.Agent, error) 
 
 	}()
 	go func() {
-		defer txnSubscription.Cancel()
 		defer svr.wg.Done()
 
 		for {
pilot: avoid cancelling the tx subscription twice, use proper wg value

In this commit we fix a newly introduce bug wherein we would close the
transaction subscription twice on shutdown. This would lead to a
shutdown, but an unclean one as it would panic due to closing a channel
twice.

We fix this my removing a defer statement such that, we’ll only cancel
the subscription once.