code: func (mp *TxPool) maybeAddOrphan(tx *btcutil.Tx, tag Tag) error {
  	// Ignore orphan transactions that are too large.  This helps avoid
  	// a memory exhaustion attack based on sending a lot of really large
  	// orphans.  In the case there is a valid transaction larger than this,
  	// it will ultimtely be rebroadcast after the parent transactions
  	// have been mined or otherwise received.
  	//
  	// Note that the number of orphan transactions in the orphan pool is
  	// also limited, so this equates to a maximum memory used of
  	// mp.cfg.Policy.MaxOrphanTxSize * mp.cfg.Policy.MaxOrphanTxs (which is ~5MB
  	// using the default values at the time this comment was written).
  	serializedLen := tx.MsgTx().SerializeSize()
  	if serializedLen > mp.cfg.Policy.MaxOrphanTxSize {
  		str := fmt.Sprintf("orphan transaction size of %d bytes is "+
  			"larger than max allowed size of %d bytes",
  			serializedLen, mp.cfg.Policy.MaxOrphanTxSize)
  		return txRuleError(wire.RejectNonstandard, str)
  	}
  
  	// Add the orphan if the none of the above disqualified it.
  	mp.addOrphan(tx, tag)
  
  	return nil
  }
docs: // maybeAddOrphan potentially adds an orphan to the orphan pool.
  //
  // This function MUST be called with the mempool lock held (for writes).