Skip to content

Instantly share code, notes, and snippets.

@nakajo2011
Last active February 5, 2019 16:02
Show Gist options
  • Save nakajo2011/c1f14c988fa8e5a61ae8a115ab8a6e67 to your computer and use it in GitHub Desktop.
Save nakajo2011/c1f14c988fa8e5a61ae8a115ab8a6e67 to your computer and use it in GitHub Desktop.
20190206 blog parts2 reference from rev:27ce4eb78bdf5d9b742ed05babe9b86a434733a1
L798-L803
// AddRemote enqueues a single transaction into the pool if it is valid. If the
// sender is not among the locally tracked ones, full pricing constraints will
// apply.
func (pool *TxPool) AddRemote(tx *types.Transaction) error {
return pool.addTx(tx, false)
}
...
L631-L641
// add validates a transaction and inserts it into the non-executable queue for
// later pending promotion and execution. If the transaction is a replacement for
// an already pending or queued one, it overwrites the previous and returns this
// so outer code doesn't uselessly call promote.
//
// If a newly added transaction is marked as local, its sending account will be
// whitelisted, preventing any associated transaction from being dropped out of
// the pool due to pricing constraints.
func (pool *TxPool) add(tx *types.Transaction, local bool) (bool, error) {
// If the transaction is already known, discard it
hash := tx.Hash()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment