private void maybeMarkCurrentKeyAsUsed ( DeterministicKey key ) { // It's OK for currentKeys to be empty here: it means we're a married wallet and the key may be a part of a // rotating chain. for ( Map . Entry < KeyChain . KeyPurpose , DeterministicKey > entry : currentKeys . entrySet ( ) ) { if ( entry . getValue ( ) != null && entry . getValue ( ) . equals ( key ) ) { log . info ( "Marking key as used: {}" , key ) ; currentKeys . put ( entry . getKey ( ) , freshKey ( entry . getKey ( ) ) ) ; return ; } } }
If the given key is current advance the current key to a new one .