rpc: acquire global coin select lock in related RPCs

This ensures proper coin selection synchronization between lnd and users
of the RPC to avoid potential double spend errors.
This commit is contained in:
Wilmer Paulino
2020-06-09 19:37:17 -07:00
parent 9d9e54f83e
commit c2f1fe26c1
4 changed files with 44 additions and 4 deletions

View File

@@ -153,6 +153,9 @@ func (s *subRPCServerConfigs) PopulateDependencies(cfg *Config, cc *chainControl
subCfgValue.FieldByName("Wallet").Set(
reflect.ValueOf(cc.wallet),
)
subCfgValue.FieldByName("CoinSelectionLocker").Set(
reflect.ValueOf(cc.wallet),
)
subCfgValue.FieldByName("KeyRing").Set(
reflect.ValueOf(cc.keyRing),
)