Branch: refs/heads/master
  Home:   https://github.com/btcsuite/btcwallet
  Commit: e12d23716fd2f012ed8e37db9b011d65dcd634fe
      
https://github.com/btcsuite/btcwallet/commit/e12d23716fd2f012ed8e37db9b011d65dcd634fe
  Author: Josh Rickmar <[email protected]>
  Date:   2016-04-05 (Tue, 05 Apr 2016)

  Changed paths:
    A wtxmgr/kahnsort.go
    M wtxmgr/unconfirmed.go

  Log Message:
  -----------
  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.


Reply via email to