From 0ce9003ba77c0552c9058caa55d2fea6711ac18c Mon Sep 17 00:00:00 2001
From: obscuren <geffobscura@gmail.com>
Date: Tue, 1 Jul 2014 12:16:14 +0200
Subject: [PATCH] Fix for creating a tx from an unknown account

---
 ethpub/pub.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ethpub/pub.go b/ethpub/pub.go
index 1bc9e0ce7..250ba71f3 100644
--- a/ethpub/pub.go
+++ b/ethpub/pub.go
@@ -216,7 +216,7 @@ func (lib *PEthereum) createTx(key, recipient, valueStr, gasStr, gasPriceStr, sc
 		tx = ethchain.NewTransactionMessage(hash, value, gas, gasPrice, data)
 	}
 
-	acc := lib.stateManager.TransState().GetStateObject(keyPair.Address())
+	acc := lib.stateManager.TransState().GetOrNewStateObject(keyPair.Address())
 	tx.Nonce = acc.Nonce
 	acc.Nonce += 1
 	lib.stateManager.TransState().UpdateStateObject(acc)
-- 
GitLab