fix: don't override a transaction's recentBlockhash when calling simulate if it's already set (#24280)
* Update simulate to add blockhash if not exist Simulate has been overriding the recentBlockhash of the passed Transaction which can be considered destructive and with side effects. Since the purpose of this function is to purely simulate, it should not override recentBlockhash if it has already been set Refs https://github.com/solana-labs/solana/issues/24279 * Apply prettier
This commit is contained in:
parent
a43ff3bbcb
commit
d8c45a69c3
|
@ -3888,7 +3888,11 @@ export class Connection {
|
|||
} else {
|
||||
let disableCache = this._disableBlockhashCaching;
|
||||
for (;;) {
|
||||
transaction.recentBlockhash = await this._recentBlockhash(disableCache);
|
||||
if (!transaction.recentBlockhash) {
|
||||
transaction.recentBlockhash = await this._recentBlockhash(
|
||||
disableCache,
|
||||
);
|
||||
}
|
||||
|
||||
if (!signers) break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue