Log sent tx ids to debug.

While here, add createdTx to unmined pool for 'sendfrom' commands as
well, instead of just 'sendmany'.
This commit is contained in:
Josh Rickmar 2013-11-07 15:29:17 -05:00
parent 3cd9a96dc7
commit cdd9bea5db

View file

@ -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