OSDN Git Service

Merge pull request #201 from Bytom/v0.1
[bytom/vapor.git] / proposal / sort.go
diff --git a/proposal/sort.go b/proposal/sort.go
new file mode 100644 (file)
index 0000000..45e80e2
--- /dev/null
@@ -0,0 +1,9 @@
+package proposal
+
+import "github.com/vapor/protocol"
+
+type byTime []*protocol.TxDesc
+
+func (a byTime) Len() int           { return len(a) }
+func (a byTime) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
+func (a byTime) Less(i, j int) bool { return a[i].Added.Before(a[j].Added) }