@ Override public Script freshOutputScript ( KeyPurpose purpose ) { DeterministicKey followedKey = getKey ( purpose ) ; ImmutableList . Builder < ECKey > keys = ImmutableList . < ECKey > builder ( ) . add ( followedKey ) ; for ( DeterministicKeyChain keyChain : followingKeyChains ) { DeterministicKey followingKey = keyChain . getKey ( purpose ) ; checkState ( followedKey . getChildNumber ( ) . equals ( followingKey . getChildNumber ( ) ) , "Following keychains should be in sync" ) ; keys . add ( followingKey ) ; } List < ECKey > marriedKeys = keys . build ( ) ; Script redeemScript = ScriptBuilder . createRedeemScript ( sigsRequiredToSpend , marriedKeys ) ; return ScriptBuilder . createP2SHOutputScript ( redeemScript ) ; }
Create a new married key and return the matching output script