public Response sendTransaction ( Transaction tx ) { if ( this . peers . isEmpty ( ) ) { throw new NoValidPeerException ( String . format ( "chain %s has no peers" , getName ( ) ) ) ; } for ( Peer peer : peers ) { try { return peer . sendTransaction ( tx ) ; } catch ( PeerException exp ) { logger . info ( String . format ( "Failed sending transaction to peer:%s" , exp . getMessage ( ) ) ) ; } } throw new RuntimeException ( "No peer available to respond" ) ; }
Send a transaction to a peer .