From cdd9bea5dbcff1ba07eaacf91d89afcbf060bb60 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Thu, 7 Nov 2013 15:29:17 -0500 Subject: [PATCH] Log sent tx ids to debug. While here, add createdTx to unmined pool for 'sendfrom' commands as well, instead of just 'sendmany'. --- cmdmgr.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmdmgr.go b/cmdmgr.go index 0772129..d6f2be5 100644 --- a/cmdmgr.go +++ b/cmdmgr.go @@ -429,6 +429,13 @@ func SendFrom(reply chan []byte, msg *btcjson.Message) { w.UtxoStore.Unlock() } + // Add hex string of raw tx to sent tx pool. If future blocks + // do not contain a tx, a resend is attempted. + UnminedTxs.Lock() + UnminedTxs.m[TXID(result.(string))] = createdTx + UnminedTxs.Unlock() + + log.Debugf("sent transaction %v", result) ReplySuccess(reply, msg.Id, result) // TODO(jrick): If message succeeded in being sent, save the @@ -602,6 +609,7 @@ func SendMany(reply chan []byte, msg *btcjson.Message) { UnminedTxs.m[TXID(result.(string))] = createdTx UnminedTxs.Unlock() + log.Debugf("sent transaction %v", result) ReplySuccess(reply, msg.Id, result) // TODO(jrick): If message succeeded in being sent, save the