Commit graph

6 commits

Author SHA1 Message Date
Wilmer Paulino
9b37298bad
wtxmgr: export dependencySort 2019-01-31 16:42:53 -08:00
Wilmer Paulino
fe56fdb828
wtxmgr: refactor dependencySort to use wire.MsgTx 2019-01-31 16:41:19 -08:00
Olaoluwa Osuntokun
7770cac383 multi: switch import paths back to upstream 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
3dc7a8529c multi: switch all imports to roasbeef's forks 2018-05-23 19:38:56 -07:00
Dave Collins
e92f94dcd1 Update for recent chainhash-related API changes. (#450)
This updates all code to make use of the new chainhash package since the
old wire.ShaHash type and related functions have been removed in favor
of the abstracted package.

Also, while here, rename all variables that included sha in their name
to include hash instead.

Finally, update glide.lock to use the required version of btcd, btcutil,
and btcrpcclient.
2016-08-08 14:49:09 -05:00
Josh Rickmar
e12d23716f Sort unmined transactions in their dependency order.
This changes the wtxmgr.Store.UnminedTxs method to sort transactions,
using the Kahn topological sort algorithm, before returning
transactions to the caller.  This is possible because transactions
form a sort of directed acyclic graph (DAG) where transactions
reference other transactions to spend their outputs (multiple
referenced outputs from a single transaction spent by the same
transaction count as a single graph edge).

This prevents the possibility of orphan rejection errors when sending
unmined transactions to a full node at startup.  As these transactions
are sent using the sendrawtransaction RPC, which does not permit
orphans, this topological sort is required.

Fixes #156.
2016-04-05 11:11:15 -04:00